Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ pass email to cs #377

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 (
<div className="flex flex-col justify-between gap-4">
<div className="flex justify-between gap-4">
Expand All @@ -70,13 +69,13 @@ const MypageButtons = ({ lng }: PropsWithLng) => {
<div className="h-[1px] bg-greyLight dark:bg-dark_greyBorder" />

<div className="flex justify-between gap-4">
<Link href={CS_PAGE_URL} className="flex-1">
<CSLink className="flex-1">
<MypageButton
align="right"
icon={<FlagIcon className={ICON_CLASSNAME} />}
buttonText={t('mypage.feedback')}
/>
</Link>
</CSLink>
</div>
</div>
);
Expand Down
16 changes: 11 additions & 5 deletions src/app/components/layout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -47,11 +49,15 @@ const Footer = async ({ lng }: PropsWithLng) => {
<div key={title} className="flex w-32 flex-col gap-2 md:gap-6">
<div className="text-sm font-bold">{title}</div>
<div className="flex flex-col gap-2">
{links.map(({ link, name }) => (
<ExternalLink key={name} href={link}>
{name}
</ExternalLink>
))}
{links.map(({ link, name }) =>
name === 'Bug Report' ? (
ParkJumyung marked this conversation as resolved.
Show resolved Hide resolved
<CSLink key={name}>{name}</CSLink>
) : (
<ExternalLink key={name} href={link}>
{name}
</ExternalLink>
),
)}
</div>
</div>
),
Expand Down
25 changes: 25 additions & 0 deletions src/app/components/shared/CSLink/CSLink.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Link
href={`https://cs.gistory.me/?service=Ziggle${
session && `&email=${session.user.email}`
ParkJumyung marked this conversation as resolved.
Show resolved Hide resolved
}`}
className={className}
>
{children}
</Link>
);
};
ParkJumyung marked this conversation as resolved.
Show resolved Hide resolved

export default CSLink;
Loading