Skip to content

Commit

Permalink
fix: useTranslation -> createTranslation
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar committed Nov 16, 2023
1 parent d98ed9e commit f7bbc05
Showing 1 changed file with 48 additions and 45 deletions.
93 changes: 48 additions & 45 deletions src/app/[lng]/mypage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
import MypageProfile from "./MypageProfile";
import MypageSeperate from "./MypageSeperate";
import MypageTable from "./MypageTable";
import { useTranslation } from '@/app/i18next';
import { createTranslation } from '@/app/i18next';

import { Locale } from '../../i18next/settings';
import MypageProfile from './MypageProfile';
import MypageSeperate from './MypageSeperate';
import MypageTable from './MypageTable';

export default async function MyPage({
params: { lng },
}: {
params: { lng: Locale };
}) {
const { t } = await useTranslation(lng, 'translation');

return (
<>

<div className={`mt-10 w-full flex h-1500 xl:h-1000 justify-center items-center flex-col xl:flex-row gap-20`}>
<div className="flex flex-col relative m-10">
<MypageProfile
logout={t('mypage.logout')}
quit={t('mypage.quit')}
const { t } = await createTranslation(lng, 'translation');

name={"김지현"}
id={"201910808"}
email={"ss@gm.gist.ac.kr"}
phone={"010-0000-0000"}/>
<div className="xl:flex hidden">
return (
<>
<div
className={`mt-10 w-full flex h-1500 xl:h-1000 justify-center items-center flex-col xl:flex-row gap-20`}
>
<div className="flex flex-col relative m-10">
<MypageProfile
logout={t('mypage.logout')}
quit={t('mypage.quit')}
name={'김지현'}
id={'201910808'}
email={'ss@gm.gist.ac.kr'}
phone={'010-0000-0000'}
/>
<div className="xl:flex hidden">
<MypageSeperate />
</div>
</div>
<div className={`flex justify-center items-center flex-col`}>
<div className={`mb-10 p-0 xl:p-50`}>
<MypageTable
totalList={t('mypage.totalList')}
noArticle={t('mypage.noArticle')}


title={t('mypage.myNotice')}
articles={[]}
link={""} />
</div>
<div className={`p-0 xl:p-50 `}>
<MypageTable
totalList={t('mypage.totalList')}
noArticle={t('mypage.noArticle')}

title={t('mypage.remindNotice')}
articles={[{"title":"제목1","createdAt":"2021-09-01"},{"title":"제목2","createdAt":"2021-09-02"}]}
link={""} />
</div>
</div>
</div>
<div className={`flex justify-center items-center flex-col`}>
<div className={`mb-10 p-0 xl:p-50`}>
<MypageTable
totalList={t('mypage.totalList')}
noArticle={t('mypage.noArticle')}
title={t('mypage.myNotice')}
articles={[]}
link={''}
/>
</div>
<div className={`p-0 xl:p-50 `}>
<MypageTable
totalList={t('mypage.totalList')}
noArticle={t('mypage.noArticle')}
title={t('mypage.remindNotice')}
articles={[
{ title: '제목1', createdAt: '2021-09-01' },
{ title: '제목2', createdAt: '2021-09-02' },
]}
link={''}
/>
</div>
</div>
</>
);
};
</div>
</>
);
}

0 comments on commit f7bbc05

Please sign in to comment.