From 562db0058e588d4d228706340606513d3a6f6ff7 Mon Sep 17 00:00:00 2001 From: giancarlo Date: Sun, 21 Apr 2024 00:20:46 +0800 Subject: [PATCH] Refactor UI components and replace PageHeader with AccountLayoutHeader This commit includes a major refactor of UI components to enhance the overall look and feel of the platform. The PageHeader component has been replaced by AccountLayoutHeader across multiple pages including settings, members, and billing. The new AccountLayoutHeader also includes an additional `account` prop, enhancing the component's functionality. Furthermore, this commit includes modifications to the marketing page styling, ensuring better spacing and alignment of features. --- .../home/[account]/billing/page.tsx | 8 +- .../home/[account]/members/page.tsx | 6 +- .../home/[account]/settings/page.tsx | 6 +- apps/web/app/(marketing)/page.tsx | 109 ++++++++++-------- 4 files changed, 72 insertions(+), 57 deletions(-) diff --git a/apps/web/app/(dashboard)/home/[account]/billing/page.tsx b/apps/web/app/(dashboard)/home/[account]/billing/page.tsx index 325d07ad6..8969359dd 100644 --- a/apps/web/app/(dashboard)/home/[account]/billing/page.tsx +++ b/apps/web/app/(dashboard)/home/[account]/billing/page.tsx @@ -6,17 +6,18 @@ import { } from '@kit/billing-gateway/components'; import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert'; import { If } from '@kit/ui/if'; -import { PageBody, PageHeader } from '@kit/ui/page'; +import { PageBody } from '@kit/ui/page'; import { Trans } from '@kit/ui/trans'; import { cn } from '@kit/ui/utils'; -import { createBillingPortalSession } from '~/(dashboard)/home/[account]/billing/server-actions'; import billingConfig from '~/config/billing.config'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; import { withI18n } from '~/lib/i18n/with-i18n'; +import { AccountLayoutHeader } from '../_components/account-layout-header'; import { loadTeamAccountBillingPage } from '../_lib/server/team-account-billing-page.loader'; import { loadTeamWorkspace } from '../_lib/server/team-account-workspace.loader'; +import { createBillingPortalSession } from '../billing/server-actions'; import { TeamAccountCheckoutForm } from './_components/team-account-checkout-form'; interface Params { @@ -71,9 +72,10 @@ async function TeamAccountBillingPage({ params }: Params) { return ( <> - } description={} + account={params.account} /> diff --git a/apps/web/app/(dashboard)/home/[account]/members/page.tsx b/apps/web/app/(dashboard)/home/[account]/members/page.tsx index 94ae5c8ba..b3d0ce107 100644 --- a/apps/web/app/(dashboard)/home/[account]/members/page.tsx +++ b/apps/web/app/(dashboard)/home/[account]/members/page.tsx @@ -17,13 +17,14 @@ import { CardTitle, } from '@kit/ui/card'; import { If } from '@kit/ui/if'; -import { PageBody, PageHeader } from '@kit/ui/page'; +import { PageBody } from '@kit/ui/page'; import { Trans } from '@kit/ui/trans'; import { Database } from '~/lib/database.types'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; import { withI18n } from '~/lib/i18n/with-i18n'; +import { AccountLayoutHeader } from '../_components/account-layout-header'; import { loadTeamWorkspace } from '../_lib/server/team-account-workspace.loader'; interface Params { @@ -108,9 +109,10 @@ async function TeamAccountMembersPage({ params }: Params) { return ( <> - } description={} + account={params.account} /> diff --git a/apps/web/app/(dashboard)/home/[account]/settings/page.tsx b/apps/web/app/(dashboard)/home/[account]/settings/page.tsx index 1b891010b..77cba73d6 100644 --- a/apps/web/app/(dashboard)/home/[account]/settings/page.tsx +++ b/apps/web/app/(dashboard)/home/[account]/settings/page.tsx @@ -1,10 +1,11 @@ import { TeamAccountSettingsContainer } from '@kit/team-accounts/components'; -import { PageBody, PageHeader } from '@kit/ui/page'; +import { PageBody } from '@kit/ui/page'; import { Trans } from '@kit/ui/trans'; import pathsConfig from '~/config/paths.config'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; +import { AccountLayoutHeader } from '../_components/account-layout-header'; import { loadTeamWorkspace } from '../_lib/server/team-account-workspace.loader'; export const generateMetadata = async () => { @@ -39,9 +40,10 @@ async function TeamAccountSettingsPage(props: Props) { return ( <> - } description={} + account={props.params.account} /> diff --git a/apps/web/app/(marketing)/page.tsx b/apps/web/app/(marketing)/page.tsx index 9d0f6a292..4999207df 100644 --- a/apps/web/app/(marketing)/page.tsx +++ b/apps/web/app/(marketing)/page.tsx @@ -104,7 +104,7 @@ function Home() {
-
+
- -
+ +
- Authentication +
+ Authentication - - Secure and Easy-to-Use Authentication for Your SaaS Website - and API - + + Secure and Easy-to-Use Authentication for Your SaaS Website + and API + +
@@ -156,9 +160,9 @@ function Home() { secure, easy-to-use, and fully customizable. It supports email/password, social logins, and more.
- +
- + {'Sign - + - + {'Dashboard'} - + - -
+ +
- Dashboard +
+ Dashboard - - A fantastic dashboard to manage your SaaS business - + + A fantastic dashboard to manage your SaaS business + +
@@ -201,24 +207,26 @@ function Home() { at a glance all you need to know about your business. It is fully customizable and extendable.
- +
- -
+ +
- Billing +
+ Billing - - A powerful billing system for your SaaS business - + + A powerful billing system for your SaaS business + +
@@ -226,9 +234,9 @@ function Home() { such as Stripe, Lemon Squeezy and Paddle. Fully customizable and easy to use.
- +
- + {'Billing'} - +
@@ -310,7 +318,7 @@ function FeatureShowcaseContainer(props: React.PropsWithChildren) { return (
@@ -319,17 +327,18 @@ function FeatureShowcaseContainer(props: React.PropsWithChildren) { ); } -function LeftFeatureContainer(props: React.PropsWithChildren) { +function FeatureContainer( + props: React.PropsWithChildren<{ + className?: string; + reverse?: boolean; + }>, +) { return ( -
- {props.children} -
- ); -} - -function RightFeatureContainer(props: React.PropsWithChildren) { - return ( -
+
{props.children}
);