From b0a314faf1de309c7f55f6ba5cae2046c87ace42 Mon Sep 17 00:00:00 2001 From: ParkJumyung Date: Tue, 8 Oct 2024 14:05:45 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20pass=20email=20to=20cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mypage/MypageButton.tsx | 7 +++--- src/app/components/layout/Footer/Footer.tsx | 16 ++++++++---- src/app/components/shared/CSLink/CSLink.tsx | 25 +++++++++++++++++++ 3 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 src/app/components/shared/CSLink/CSLink.tsx diff --git a/src/app/[lng]/(with-page-layout)/(without-sidebar-layout)/mypage/MypageButton.tsx b/src/app/[lng]/(with-page-layout)/(without-sidebar-layout)/mypage/MypageButton.tsx index a8af0358..c75cc7ec 100644 --- a/src/app/[lng]/(with-page-layout)/(without-sidebar-layout)/mypage/MypageButton.tsx +++ b/src/app/[lng]/(with-page-layout)/(without-sidebar-layout)/mypage/MypageButton.tsx @@ -3,6 +3,7 @@ import Link from 'next/link'; import React from 'react'; +import CSLink from '@/app/components/shared/CSLink/CSLink'; import { PropsWithLng } from '@/app/i18next'; import { useTranslation } from '@/app/i18next/client'; import BellIcon from '@/assets/icons/bell.svg'; @@ -46,8 +47,6 @@ const MypageButtons = ({ lng }: PropsWithLng) => { const ICON_CLASSNAME = 'w-10 stroke-text dark:stroke-dark_white'; - const CS_PAGE_URL = 'https://cs.gistory.me/?service=Ziggle'; - return (
@@ -70,13 +69,13 @@ const MypageButtons = ({ lng }: PropsWithLng) => {
- + } buttonText={t('mypage.feedback')} /> - +
); diff --git a/src/app/components/layout/Footer/Footer.tsx b/src/app/components/layout/Footer/Footer.tsx index 98e16445..4abe2413 100644 --- a/src/app/components/layout/Footer/Footer.tsx +++ b/src/app/components/layout/Footer/Footer.tsx @@ -6,6 +6,8 @@ import GitHubLogo from '@/assets/logos/github.svg'; import InfoteamLogo from '@/assets/logos/infoteam.svg'; import PlayStoreLogo from '@/assets/logos/playstore.svg'; +import CSLink from '../../shared/CSLink/CSLink'; + export const playStoreLink = 'https://play.google.com/store/apps/details?id=me.gistory.ziggle'; export const appStoreLink = 'https://apps.apple.com/kr/app/ziggle/id6451740697'; @@ -47,11 +49,15 @@ const Footer = async ({ lng }: PropsWithLng) => {
{title}
- {links.map(({ link, name }) => ( - - {name} - - ))} + {links.map(({ link, name }) => + name === 'Bug Report' ? ( + {name} + ) : ( + + {name} + + ), + )}
), diff --git a/src/app/components/shared/CSLink/CSLink.tsx b/src/app/components/shared/CSLink/CSLink.tsx new file mode 100644 index 00000000..531507bb --- /dev/null +++ b/src/app/components/shared/CSLink/CSLink.tsx @@ -0,0 +1,25 @@ +import Link from 'next/link'; +import { PropsWithChildren } from 'react'; + +import { auth } from '@/api/auth/auth'; + +interface CSLinkProps extends PropsWithChildren { + className?: string; +} + +const CSLink = async ({ children, className }: CSLinkProps) => { + const session = await auth(); + + return ( + + {children} + + ); +}; + +export default CSLink; From 72492bcdc19b35076b6155fef4ed218e64b8a4ec Mon Sep 17 00:00:00 2001 From: ParkJumyung Date: Thu, 10 Oct 2024 13:47:05 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20omit=20email=20param=20to=20?= =?UTF-8?q?cs=20if=20there=20is=20no=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/shared/CSLink/CSLink.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/shared/CSLink/CSLink.tsx b/src/app/components/shared/CSLink/CSLink.tsx index 531507bb..8f66b50d 100644 --- a/src/app/components/shared/CSLink/CSLink.tsx +++ b/src/app/components/shared/CSLink/CSLink.tsx @@ -13,7 +13,7 @@ const CSLink = async ({ children, className }: CSLinkProps) => { return ( From 71cce0c65b0ec47a8bad65991b303702eec6a71c Mon Sep 17 00:00:00 2001 From: ParkJumyung Date: Thu, 10 Oct 2024 13:47:47 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20make=20footer=20link=20subst?= =?UTF-8?q?itution=20language=20independent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/layout/Footer/Footer.tsx | 42 ++++++++++++--------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/app/components/layout/Footer/Footer.tsx b/src/app/components/layout/Footer/Footer.tsx index 4abe2413..5c346e6c 100644 --- a/src/app/components/layout/Footer/Footer.tsx +++ b/src/app/components/layout/Footer/Footer.tsx @@ -1,6 +1,6 @@ import Link from 'next/link'; -import { createTranslation, PropsWithLng } from '@/app/i18next'; +import { createTranslation, PropsWithLng, T } from '@/app/i18next'; import AppStoreLogo from '@/assets/logos/appstore.svg'; import GitHubLogo from '@/assets/logos/github.svg'; import InfoteamLogo from '@/assets/logos/infoteam.svg'; @@ -16,6 +16,12 @@ const ExternalLink = ({ ...props }: React.ComponentProps) => ( ); +interface FooterLink { + name: string; + link: string; + key?: string; +} + const Footer = async ({ lng }: PropsWithLng) => { const { t } = await createTranslation(lng); @@ -44,24 +50,24 @@ const Footer = async ({ lng }: PropsWithLng) => {
{t('footer.copyright')}
- {t('footer.sections', { returnObjects: true }).map( - ({ title, links }) => ( -
-
{title}
-
- {links.map(({ link, name }) => - name === 'Bug Report' ? ( - {name} - ) : ( - - {name} - - ), - )} -
+ {t('footer.sections', { + returnObjects: true, + }).map(({ title, links }) => ( +
+
{title}
+
+ {links.map(({ link, name, key }: FooterLink) => + key === 'bugReport' ? ( + {name} + ) : ( + + {name} + + ), + )}
- ), - )} +
+ ))}
); From edb4420028f76b2dacd27efc43376b10e1ca30ec Mon Sep 17 00:00:00 2001 From: ParkJumyung Date: Thu, 10 Oct 2024 13:53:10 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A5=20remove=20unused=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/layout/Footer/Footer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/layout/Footer/Footer.tsx b/src/app/components/layout/Footer/Footer.tsx index 5c346e6c..0c1319f7 100644 --- a/src/app/components/layout/Footer/Footer.tsx +++ b/src/app/components/layout/Footer/Footer.tsx @@ -1,6 +1,6 @@ import Link from 'next/link'; -import { createTranslation, PropsWithLng, T } from '@/app/i18next'; +import { createTranslation, PropsWithLng } from '@/app/i18next'; import AppStoreLogo from '@/assets/logos/appstore.svg'; import GitHubLogo from '@/assets/logos/github.svg'; import InfoteamLogo from '@/assets/logos/infoteam.svg';