Refactor admin dashboard loader and update translations

The admin-dashboard.loader file was refactored to use a newly created AdminDashboardService. This service encapsulates the logic for fetching dashboard data. Translations related to account settings, privacy policy, terms of service, and cookie policy were updated for better readability. Changes also include minor reorganizing of code files for clearer structure.
This commit is contained in:
giancarlo
2024-04-22 20:30:21 +08:00
parent 8c5b0496da
commit 8e1d7ad1f5
18 changed files with 120 additions and 68 deletions
@@ -18,13 +18,8 @@ function UserHomePage() {
return (
<>
<UserAccountHeader
title={<Trans i18nKey={'common:homeTabLabel'} defaults={'Home'} />}
description={
<Trans
i18nKey={'common:homeTabDescription'}
defaults={'Welcome to your Home Page'}
/>
}
title={<Trans i18nKey={'common:homeTabLabel'} />}
description={<Trans i18nKey={'common:homeTabDescription'} />}
/>
<PageBody></PageBody>
@@ -7,8 +7,8 @@ function UserSettingsLayout(props: React.PropsWithChildren) {
return (
<>
<UserAccountHeader
title={<Trans i18nKey={'common:yourAccountTabLabel'} />}
description={'Manage your account settings'}
title={<Trans i18nKey={'account:accountTabLabel'} />}
description={<Trans i18nKey={'account:accountTabDescription'} />}
/>
{props.children}
@@ -18,7 +18,7 @@ async function CookiePolicyPage() {
<div className={'container mx-auto'}>
<SitePageHeader
title={t(`marketing:cookiePolicy`)}
subtitle={`This is the cookie policy page. It's a great place to put information about the cookies your site uses.`}
subtitle={t(`marketing:cookiePolicyDescription`)}
/>
</div>
</div>
@@ -16,7 +16,10 @@ async function PrivacyPolicyPage() {
return (
<div className={'mt-8'}>
<div className={'container mx-auto'}>
<SitePageHeader title={t('marketing.privacyPolicy')} subtitle={``} />
<SitePageHeader
title={t('marketing:privacyPolicy')}
subtitle={t('marketing:privacyPolicyDescription')}
/>
</div>
</div>
);
@@ -16,7 +16,10 @@ async function TermsOfServicePage() {
return (
<div className={'mt-8'}>
<div className={'container mx-auto'}>
<SitePageHeader title={t(`marketing:termsOfService`)} subtitle={``} />
<SitePageHeader
title={t(`marketing:termsOfService`)}
subtitle={t(`marketing:termsOfServiceDescription`)}
/>
</div>
</div>
);
@@ -62,7 +62,11 @@ async function BlogPost({ params }: { params: { slug: string } }) {
notFound();
}
return <Post post={post} content={post.content} />;
return (
<div className={'container'}>
<Post post={post} content={post.content} />;
</div>
);
}
export default withI18n(BlogPost);