diff --git a/.github/workflows/deploy-prod-cn.yml b/.github/workflows/deploy-prod-cn.yml index c71c9e1..866c406 100644 --- a/.github/workflows/deploy-prod-cn.yml +++ b/.github/workflows/deploy-prod-cn.yml @@ -45,7 +45,7 @@ jobs: docker load -i image.tar - name: Login to Qcloud Hongkong Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: hkccr.ccs.tencentyun.com username: "${{ vars.QCLOUD_REGISTRY_USERNAME }}" diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 98eef6a..ef1fcea 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v6 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Create Env run: | @@ -47,7 +47,7 @@ jobs: echo "Created .env file with provided secrets and variables" - name: Build Docker image - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 timeout-minutes: 10 with: context: . diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 9a45657..acbfa9f 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -61,6 +61,10 @@ "event.mapLoading": "Loading map", "event.gotoGaoDe": "View on Gaode Map", "event.gotoOrganization": "View Organizer details", + "event.hostSwitchGroupAria": "Switch host organization", + "event.prevHostOrganization": "Previous organizer", + "event.nextHostOrganization": "Next organizer", + "event.hostOrganizationCounter": "Organizer {{index}}/{{total}}", "event.dateFormat": "MMMM DD, YYYY", "organization.active": "Active Organizers", "organization.inactive": "Inactive Organizers", diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index 56dbac1..3a1e69c 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -61,6 +61,10 @@ "event.mapLoading": "Открыть в Gaode Map...", "event.gotoGaoDe": "Открыть в Gaode Map", "event.gotoOrganization": "Участники и стенды", + "event.hostSwitchGroupAria": "Переключить организатора", + "event.prevHostOrganization": "Предыдущий организатор", + "event.nextHostOrganization": "Следующий организатор", + "event.hostOrganizationCounter": "Организатор {{index}}/{{total}}", "event.dateFormat": "MMMM DD, YYYY", "organization.active": "Активные организаторы", "organization.inactive": "Неактивные организаторы", diff --git a/public/locales/zh-Hans/common.json b/public/locales/zh-Hans/common.json index 80007b7..4030a33 100644 --- a/public/locales/zh-Hans/common.json +++ b/public/locales/zh-Hans/common.json @@ -63,6 +63,10 @@ "event.retryLoadMap": "尝试重新加载地图", "event.gotoGaoDe": "去高德地图查看", "event.gotoOrganization": "看看展商详情", + "event.hostSwitchGroupAria": "切换主办/展商", + "event.prevHostOrganization": "上一个主办", + "event.nextHostOrganization": "下一个主办", + "event.hostOrganizationCounter": "主办方 {{index}}/{{total}}", "event.dateFormat": "YYYY年MM月DD日", "organization.active": "活跃展商", "organization.inactive": "停止活动展商", diff --git a/public/locales/zh-Hant/common.json b/public/locales/zh-Hant/common.json index 0e7020a..aeee6b8 100644 --- a/public/locales/zh-Hant/common.json +++ b/public/locales/zh-Hant/common.json @@ -63,6 +63,10 @@ "event.retryLoadMap": "重新載入地圖", "event.gotoGaoDe": "用高德地圖查看", "event.gotoOrganization": "查看主辦單位", + "event.hostSwitchGroupAria": "切換主辦/展商", + "event.prevHostOrganization": "上一個主辦", + "event.nextHostOrganization": "下一個主辦", + "event.hostOrganizationCounter": "主辦方 {{index}}/{{total}}", "event.dateFormat": "YYYY年MM月DD日", "organization.active": "營運中", "organization.inactive": "已停辦", diff --git a/src/components/event/EventOrganizationCard.tsx b/src/components/event/EventOrganizationCard.tsx new file mode 100644 index 0000000..d8233ac --- /dev/null +++ b/src/components/event/EventOrganizationCard.tsx @@ -0,0 +1,155 @@ +import NextImage from "@/components/image"; +import { + BiliButton, + EmailButton, + FacebookButton, + PlurkButton, + QQGroupButton, + RednoteButton, + TwitterButton, + WebsiteButton, + WeiboButton, +} from "@/components/OrganizationLinkButton"; +import OrganizationStatus from "@/components/organizationStatus"; +import type { EventItem } from "@/types/event"; +import { sendTrack } from "@/utils/track"; +import clsx from "clsx"; +import { useTranslation } from "next-i18next/pages"; +import Link from "next/link"; +import { useState } from "react"; +import { IoChevronBack, IoChevronForward } from "react-icons/io5"; + +type EventOrganizationCardProps = { + event: EventItem; + showDescriptionContainer: boolean; +}; + +export default function EventOrganizationCard(props: EventOrganizationCardProps) { + const { t } = useTranslation(); + const orgList = [props.event.organization, ...props.event.organizations]; + const [activeIndex, setActiveIndex] = useState(0); + const showOrgSwitcher = orgList.length > 1; + + const organization = orgList[activeIndex] ?? orgList[0]!; + const organizationProfileHref = `/${organization.slug}`; + const trackOrganizationProfileClick = () => { + sendTrack({ + eventName: "click-event-portal", + eventValue: { + link: organizationProfileHref, + }, + }); + }; + + const goToPrev = () => { + setActiveIndex((i) => (i - 1 + orgList.length) % orgList.length); + }; + const goToNext = () => { + setActiveIndex((i) => (i + 1) % orgList.length); + }; + + return ( +