Cleanup
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
'use server';
|
||||
|
||||
import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client';
|
||||
|
||||
/**
|
||||
* Refreshes the user session on the server when updating the user profile.
|
||||
*/
|
||||
export async function refreshSessionAction() {
|
||||
const supabase = getSupabaseServerActionClient();
|
||||
|
||||
await supabase.auth.refreshSession();
|
||||
}
|
||||
19
apps/web/app/(dashboard)/home/(user)/account/layout.tsx
Normal file
19
apps/web/app/(dashboard)/home/(user)/account/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
function UserSettingsLayout(props: React.PropsWithChildren) {
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title={<Trans i18nKey={'common:yourAccountTabLabel'} />}
|
||||
description={'Manage your account settings'}
|
||||
/>
|
||||
|
||||
<PageBody>{props.children}</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(UserSettingsLayout);
|
||||
3
apps/web/app/(dashboard)/home/(user)/account/loading.tsx
Normal file
3
apps/web/app/(dashboard)/home/(user)/account/loading.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
import { GlobalLoader } from '@kit/ui/global-loader';
|
||||
|
||||
export default GlobalLoader;
|
||||
26
apps/web/app/(dashboard)/home/(user)/account/page.tsx
Normal file
26
apps/web/app/(dashboard)/home/(user)/account/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import featureFlagsConfig from '~/config/feature-flags.config';
|
||||
import pathsConfig from '~/config/paths.config';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { PersonalAccountSettingsContainer } from '@kit/accounts/personal-account-settings';
|
||||
|
||||
function PersonalAccountSettingsPage() {
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
'container mx-auto flex max-w-2xl flex-1 flex-col items-center'
|
||||
}
|
||||
>
|
||||
<PersonalAccountSettingsContainer
|
||||
features={{
|
||||
enableAccountDeletion: featureFlagsConfig.enableAccountDeletion,
|
||||
}}
|
||||
paths={{
|
||||
callback: pathsConfig.auth.callback,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(PersonalAccountSettingsPage);
|
||||
15
apps/web/app/(dashboard)/home/(user)/billing/layout.tsx
Normal file
15
apps/web/app/(dashboard)/home/(user)/billing/layout.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import featureFlagsConfig from '~/config/feature-flags.config';
|
||||
|
||||
function UserBillingLayout(props: React.PropsWithChildren) {
|
||||
const isEnabled = featureFlagsConfig.enablePersonalAccountBilling;
|
||||
|
||||
if (!isEnabled) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return <>{props.children}</>;
|
||||
}
|
||||
|
||||
export default UserBillingLayout;
|
||||
19
apps/web/app/(dashboard)/home/(user)/billing/page.tsx
Normal file
19
apps/web/app/(dashboard)/home/(user)/billing/page.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
function PersonalAccountBillingPage() {
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title={<Trans i18nKey={'common:billingTabLabel'} />}
|
||||
description={<Trans i18nKey={'common:billingTabDescription'} />}
|
||||
/>
|
||||
|
||||
<PageBody></PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(PersonalAccountBillingPage);
|
||||
10
apps/web/app/(dashboard)/home/(user)/layout.tsx
Normal file
10
apps/web/app/(dashboard)/home/(user)/layout.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { HomeSidebar } from '~/(dashboard)/home/components/home-sidebar';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { Page } from '@kit/ui/page';
|
||||
|
||||
function UserHomeLayout({ children }: React.PropsWithChildren) {
|
||||
return <Page sidebar={<HomeSidebar />}>{children}</Page>;
|
||||
}
|
||||
|
||||
export default withI18n(UserHomeLayout);
|
||||
3
apps/web/app/(dashboard)/home/(user)/loading.tsx
Normal file
3
apps/web/app/(dashboard)/home/(user)/loading.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
import { GlobalLoader } from '@kit/ui/global-loader';
|
||||
|
||||
export default GlobalLoader;
|
||||
24
apps/web/app/(dashboard)/home/(user)/page.tsx
Normal file
24
apps/web/app/(dashboard)/home/(user)/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
function UserHomePage() {
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title={<Trans i18nKey={'common:homeTabLabel'} defaults={'Home'} />}
|
||||
description={
|
||||
<Trans
|
||||
i18nKey={'common:homeTabDescription'}
|
||||
defaults={'Welcome to your Home Page'}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
<PageBody></PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(UserHomePage);
|
||||
Reference in New Issue
Block a user