Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Update accounts area components (#1889)

Luke Vellaa4c943fe412f
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index acdf58525..5aa60a2c4 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -150,9 +150,7 @@
"scrollRight": "Scroll Right",
"shrink": "Shrink",
"expand": "Expand",
- "billingPortal": "Billing Portal",
"supportDescription": "Need help with anything?",
- "supportBilling": "Please reach out if you need any assistance.",
"contactSupport": "Contact Support",
"pricing": "Pricing",
"pollSettingsDescription": "Customize the behaviour of your poll",
@@ -257,13 +255,7 @@
"tooManyRequests": "Too many requests",
"tooManyRequestsDescription": "Please try again later.",
"loginMagicLinkError": "This link is invalid or expired. Please request a new link.",
- "subscriptionPriceMonthly": "{price} per month",
- "subscriptionPriceYearly": "{price} per year",
- "billingSubscriptionTitle": "Subscription",
"billingSubscriptionDescription": "Manage your current subscription plan.",
- "billingSubscriptionNotActive": "You are not currently subscribed to a plan.",
- "billingSubscriptionUpgradeToProDescription": "Upgrade to Pro to get access to all features and benefits.",
- "billingSubscriptionUpgradeToPro": "Upgrade to Pro",
"subscriptionStatusActive": "Active",
"subscriptionStatusTrialing": "Trialing",
"subscriptionStatusPastDue": "Past due",
@@ -274,15 +266,6 @@
"subscriptionStatusPaused": "Paused",
"subscriptionStatusIncomplete": "Incomplete",
"subscriptionStatusIncompleteExpired": "Incomplete expired",
- "billingSubscriptionPlan": "Plan",
- "billingSubscriptionPrice": "Price",
- "billingSubscriptionNextPaymentDue": "Next Payment Due",
- "billingPaymentMethod": "Payment Method",
- "noPaymentMethodSet": "No Payment Method Set",
- "addPaymentMethodDescription": "Please add a payment method to ensure uninterrupted service for your subscription.",
- "addPaymentMethod": "Add Payment Method",
- "needToMakeChanges": "Need to make changes?",
- "billingPortalDescription": "Visit the billing portal to manage your subscription, update payment methods, or view billing history.",
"priceFree": "Free",
"signUp": "Sign Up",
"upgradeToPro": "Upgrade to Pro",
@@ -474,10 +457,10 @@
"leftSpaceSuccess": "You have left the space",
"leaveSpaceDescription": "Remove yourself from this space.",
"deleteSpaceDescription": "Permanently delete this space and all its contents. This action cannot be undone.",
- "spaceSettings": "Space Settings",
"spaces": "Spaces",
"inviteMembers": "Invite Members",
"accessDenied": "Access Denied",
"ownerPermissionsRequired": "Only space owners can access billing settings.",
- "deleteSpacePermission": "You need to be the owner to delete a space."
+ "signOutSection": "Sign Out",
+ "signOutSectionDescription": "End your current session and sign out of your account"
}
diff --git a/apps/web/src/app/[locale]/(space)/account/billing/components/payment-method.tsx b/apps/web/src/app/[locale]/(space)/account/billing/components/payment-method.tsx
deleted file mode 100644
index 933454d9f..000000000
--- a/apps/web/src/app/[locale]/(space)/account/billing/components/payment-method.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import { Badge } from "@rallly/ui/badge";
-import { z } from "zod";
-
-const brandLabels = {
- visa: "Visa",
- mastercard: "Mastercard",
- amex: "American Express",
- discover: "Discover",
- unionpay: "UnionPay",
- eftpos_au: "Eftpos (AU)",
- jcb: "JCB",
- link: "Link",
- diners: "Diners Club",
- unknown: "Unknown",
-};
-
-type CardBrands = keyof typeof brandLabels;
-
-function CardDetails({ brand, last4 }: { brand: CardBrands; last4: string }) {
- const brandLabel = brandLabels[brand];
- return (
- <div className="flex items-center gap-1">
- <Badge>{brandLabel}</Badge>
- <span>**** {last4}</span>
- </div>
- );
-}
-
-const cardDataSchema = z.object({
- brand: z
- .enum([
- "visa",
- "mastercard",
- "amex",
- "discover",
- "unionpay",
- "eftpos_au",
- "jcb",
- "diners",
- "link",
- "unknown",
- ])
- .catch("unknown"),
- last4: z.string(),
-});
-
-export function PaymentMethod({ type, data }: { type: string; data: unknown }) {
- switch (type) {
- case "card": {
- const cardData = cardDataSchema.parse(data);
- return <CardDetails brand={cardData.brand} last4={cardData.last4} />;
- }
- case "link":
- return "Link";
- case "paypal":
- return "PayPal";
- default:
- return <Badge>{type}</Badge>;
- }
-}
diff --git a/apps/web/src/app/[locale]/(space)/account/billing/components/subscription-price.tsx b/apps/web/src/app/[locale]/(space)/account/billing/components/subscription-price.tsx
deleted file mode 100644
index f83665c19..000000000
--- a/apps/web/src/app/[locale]/(space)/account/billing/components/subscription-price.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-"use client";
-
-import { Trans } from "@/components/trans";
-
-/**
- * Returns the formatted price for the given amount, interval and currency.
- * eg. $7 per month, £40 per year, etc…
- */
-export function SubscriptionPrice({
- amount,
- interval,
- currency,
-}: {
- amount: number;
- interval: string;
- currency: string;
-}) {
- const formattedAmount = new Intl.NumberFormat("en", {
- style: "currency",
- currency: currency,
- minimumFractionDigits: 2,
- }).format(amount / 100); // Divide by 100 since amount is in cents
-
- return (
- <span>
- {interval === "month" ? (
- <Trans
- i18nKey="subscriptionPriceMonthly"
- defaults="{price} per month"
- values={{ price: formattedAmount }}
- />
- ) : (
- <Trans
- i18nKey="subscriptionPriceYearly"
- defaults="{price} per year"
- values={{ price: formattedAmount }}
- />
- )}
- </span>
- );
-}
diff --git a/apps/web/src/app/[locale]/(space)/account/billing/page.tsx b/apps/web/src/app/[locale]/(space)/account/billing/page.tsx
deleted file mode 100644
index 1fe14c5a0..000000000
--- a/apps/web/src/app/[locale]/(space)/account/billing/page.tsx
+++ /dev/null
@@ -1,322 +0,0 @@
-import { Badge } from "@rallly/ui/badge";
-import { Button } from "@rallly/ui/button";
-import { DialogTrigger } from "@rallly/ui/dialog";
-import { Icon } from "@rallly/ui/icon";
-import {
- ArrowUpRightIcon,
- CircleAlertIcon,
- CreditCardIcon,
- GemIcon,
- PlusIcon,
- SendIcon,
- SparklesIcon,
-} from "lucide-react";
-import type { Metadata } from "next";
-import Link from "next/link";
-import { notFound } from "next/navigation";
-import {
- PageContainer,
- PageContent,
- PageHeader,
- PageTitle,
-} from "@/app/components/page-layout";
-import { requireUser } from "@/auth/data";
-import {
- DescriptionDetails,
- DescriptionList,
- DescriptionTerm,
-} from "@/components/description-list";
-import {
- EmptyState,
- EmptyStateDescription,
- EmptyStateFooter,
- EmptyStateIcon,
- EmptyStateTitle,
-} from "@/components/empty-state";
-import { PayWallDialog } from "@/components/pay-wall-dialog";
-import { Trans } from "@/components/trans";
-import { SubscriptionStatus } from "@/features/billing/components/subscription-status";
-import { loadPaymentMethods, loadSubscription } from "@/features/space/data";
-import { getTranslation } from "@/i18n/server";
-import { isFeatureEnabled } from "@/lib/feature-flags/server";
-import { FormattedDateTime } from "@/lib/timezone/client/formatted-date-time";
-import {
- SettingsContent,
- SettingsSection,
-} from "../components/settings-layout";
-import { PaymentMethod } from "./components/payment-method";
-import { SubscriptionPrice } from "./components/subscription-price";
-
-async function loadData() {
- const [user, subscription, paymentMethods] = await Promise.all([
- requireUser(),
- loadSubscription(),
- loadPaymentMethods(),
- ]);
-
- return { user, subscription, paymentMethods };
-}
-
-export default async function Page() {
- if (!isFeatureEnabled("billing")) {
- notFound();
- }
-
- const { user, subscription, paymentMethods } = await loadData();
-
- return (
- <PageContainer>
- <PageHeader>
- <PageTitle>
- <Trans i18nKey="billing" defaults="Billing" />
- </PageTitle>
- </PageHeader>
- <PageContent>
- {" "}
- <SettingsContent>
- <SettingsSection
- title={
- <Trans
- i18nKey="billingSubscriptionTitle"
- defaults="Subscription"
- />
- }
- description={
- <Trans
- i18nKey="billingSubscriptionDescription"
- defaults="View and manage your current subscription plan"
- />
- }
- >
- {subscription ? (
- <div className="space-y-4">
- <DescriptionList>
- <DescriptionTerm>
- <Trans i18nKey="billingSubscriptionPlan" defaults="Plan" />
- </DescriptionTerm>
- <DescriptionDetails>
- {subscription ? (
- <div className="flex items-center gap-x-2">
- <span className="font-bold">Pro</span>
- <Badge
- variant={
- subscription.status === "active"
- ? "green"
- : "default"
- }
- >
- <SubscriptionStatus
- status={subscription.status}
- cancelAtPeriodEnd={subscription.cancelAtPeriodEnd}
- periodEnd={subscription.periodEnd}
- />
- </Badge>
- </div>
- ) : (
- "Hobby"
- )}
- </DescriptionDetails>
-
- <DescriptionTerm>
- <Trans
- i18nKey="billingSubscriptionPrice"
- defaults="Price"
- />
- </DescriptionTerm>
- <DescriptionDetails>
- {subscription ? (
- <SubscriptionPrice
- amount={subscription.amount}
- currency={subscription.currency}
- interval={subscription.interval}
- />
- ) : (
- <Trans i18nKey="priceFree" defaults="Free" />
- )}
- </DescriptionDetails>
-
- <DescriptionTerm>
- <Trans
- i18nKey="billingSubscriptionNextPaymentDue"
- defaults="Next Payment Due"
- />
- </DescriptionTerm>
- <DescriptionDetails>
- {subscription.cancelAtPeriodEnd ? (
- "-"
- ) : (
- <FormattedDateTime
- date={subscription.periodEnd}
- format="D MMM YYYY"
- />
- )}
- </DescriptionDetails>
-
- <DescriptionTerm>
- <Trans
- i18nKey="billingPaymentMethod"
- defaults="Payment Method"
- />
- </DescriptionTerm>
- <DescriptionDetails>
- {paymentMethods.length === 0 ? (
- <div>
- <div className="space-y-2">
- <div className="flex items-center gap-x-2 text-destructive">
- <CircleAlertIcon className="size-4" />
- <span className="font-medium">
- <Trans
- i18nKey="noPaymentMethodSet"
- defaults="No Payment Method Set"
- />
- </span>
- </div>
- <p className="text-muted-foreground text-sm">
- <Trans
- i18nKey="addPaymentMethodDescription"
- defaults="Please add a payment method to ensure uninterrupted service for your subscription."
- />
- </p>
- </div>
- <div className="mt-6">
- <Button variant="default" asChild>
- <Link
- prefetch={false}
- href="/api/stripe/portal/payment-methods"
- >
- <Icon>
- <PlusIcon />
- </Icon>
- <Trans
- i18nKey="addPaymentMethod"
- defaults="Add Payment Method"
- />
- </Link>
- </Button>
- </div>
- </div>
- ) : (
- <ul className="space-y-2">
- {paymentMethods.map((method) => (
- <li key={method.id}>
- <PaymentMethod
- type={method.type}
- data={method.data}
- />
- </li>
- ))}
- </ul>
- )}
- </DescriptionDetails>
- </DescriptionList>
- {user.customerId ? (
- <div className="flex flex-col items-start justify-between gap-6 gap-x-4 rounded-lg border bg-gray-50 p-4 sm:flex-row">
- <div className="space-y-1">
- <h3 className="font-medium text-sm">
- <Trans
- i18nKey="needToMakeChanges"
- defaults="Need to make changes?"
- />
- </h3>
- <p className="text-muted-foreground text-sm">
- <Trans
- i18nKey="billingPortalDescription"
- defaults="Visit the billing portal to manage your subscription, update payment methods, or view billing history."
- />
- </p>
- </div>
- <Button asChild variant="default">
- <Link
- href="/api/stripe/portal"
- prefetch={false}
- className="whitespace-nowrap"
- >
- <Icon>
- <CreditCardIcon />
- </Icon>
- <Trans
- i18nKey="billingPortal"
- defaults="Billing Portal"
- />
- <Icon>
- <ArrowUpRightIcon />
- </Icon>
- </Link>
- </Button>
- </div>
- ) : null}
- </div>
- ) : (
- <EmptyState className="py-8">
- <EmptyStateIcon>
- <GemIcon />
- </EmptyStateIcon>
- <EmptyStateTitle>
- <Trans
- i18nKey="billingSubscriptionNotActive"
- defaults="You are not currently subscribed to a plan."
- />
- </EmptyStateTitle>
- <EmptyStateDescription>
- <Trans
- i18nKey="billingSubscriptionUpgradeToProDescription"
- defaults="Upgrade to Pro to get access to all features and benefits."
- />
- </EmptyStateDescription>
- <EmptyStateFooter>
- <PayWallDialog>
- <DialogTrigger asChild>
- <Button>
- <Icon>
- <SparklesIcon />
- </Icon>
- <Trans
- i18nKey="billingSubscriptionUpgradeToPro"
- defaults="Upgrade to Pro"
- />
- </Button>
- </DialogTrigger>
- </PayWallDialog>
- </EmptyStateFooter>
- </EmptyState>
- )}
- </SettingsSection>
- <hr />
- <SettingsSection
- title={<Trans i18nKey="support" defaults="Support" />}
- description={
- <Trans
- i18nKey="supportDescription"
- defaults="Need help with anything?"
- />
- }
- >
- <div className="space-y-6">
- <p className="text-sm">
- <Trans
- i18nKey="supportBilling"
- defaults="Please reach out if you need any assistance."
- />
- </p>
- <Button asChild>
- <Link href="mailto:[email protected]">
- <SendIcon className="size-4" />
- <Trans i18nKey="contactSupport" defaults="Contact Support" />
- </Link>
- </Button>
- </div>
- </SettingsSection>
- </SettingsContent>
- </PageContent>
- </PageContainer>
- );
-}
-
-export async function generateMetadata(): Promise<Metadata> {
- const { t } = await getTranslation();
- return {
- title: t("billing", {
- defaultValue: "Billing",
- }),
- };
-}
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/loading.tsx b/apps/web/src/app/[locale]/(space)/account/preferences/loading.tsx
deleted file mode 100644
index f6c4a2fbc..000000000
--- a/apps/web/src/app/[locale]/(space)/account/preferences/loading.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { Spinner } from "@/components/spinner";
-
-export default async function Loading() {
- return <Spinner />;
-}
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/preferences-page.tsx b/apps/web/src/app/[locale]/(space)/account/preferences/preferences-page.tsx
deleted file mode 100644
index 4ba2e21a4..000000000
--- a/apps/web/src/app/[locale]/(space)/account/preferences/preferences-page.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-"use client";
-
-import { Trans } from "@/components/trans";
-
-import {
- SettingsContent,
- SettingsSection,
-} from "../components/settings-layout";
-import { DateTimePreferences } from "./components/date-time-preferences";
-import { LanguagePreference } from "./components/language-preference";
-
-export function PreferencesPage() {
- return (
- <SettingsContent>
- <SettingsSection
- title={<Trans i18nKey="language" defaults="Language" />}
- description={
- <Trans
- i18nKey="languageDescription"
- defaults="Change your preferred language"
- />
- }
- >
- <LanguagePreference />
- </SettingsSection>
- <hr />
- <SettingsSection
- title={<Trans i18nKey="dateAndTime" defaults="Date & Time" />}
- description={
- <Trans
- i18nKey="dateAndTimeDescription"
- defaults="Change your preferred date and time settings"
- />
- }
- >
- <DateTimePreferences />
- </SettingsSection>
- </SettingsContent>
- );
-}
diff --git a/apps/web/src/app/[locale]/(space)/account/profile/page.tsx b/apps/web/src/app/[locale]/(space)/account/profile/page.tsx
deleted file mode 100644
index d0ecb2c8f..000000000
--- a/apps/web/src/app/[locale]/(space)/account/profile/page.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { Button } from "@rallly/ui/button";
-import { DialogTrigger } from "@rallly/ui/dialog";
-import { TrashIcon } from "lucide-react";
-import type { Metadata } from "next";
-
-import type { Params } from "@/app/[locale]/types";
-import {
- PageContainer,
- PageContent,
- PageHeader,
- PageTitle,
-} from "@/app/components/page-layout";
-import { requireUser } from "@/auth/data";
-import { Trans } from "@/components/trans";
-import { getTranslation } from "@/i18n/server";
-import {
- SettingsContent,
- SettingsSection,
-} from "../components/settings-layout";
-import { DeleteAccountDialog } from "./delete-account-dialog";
-import { ProfileEmailAddress } from "./profile-email-address";
-import { ProfileSettings } from "./profile-settings";
-
-export default async function Page() {
- const user = await requireUser();
- return (
- <PageContainer>
- <PageHeader>
- <PageTitle>
- <Trans i18nKey="profile" defaults="Profile" />
- </PageTitle>
- </PageHeader>
- <PageContent>
- <SettingsContent>
- <SettingsSection
- title={<Trans i18nKey="profile" defaults="Profile" />}
- description={
- <Trans
- i18nKey="profileDescription"
- defaults="Set your public profile information"
- />
- }
- >
- <ProfileSettings name={user.name} image={user.image} />
- </SettingsSection>
- <SettingsSection
- title={
- <Trans i18nKey="profileEmailAddress" defaults="Email Address" />
- }
- description={
- <Trans
- i18nKey="profileEmailAddressDescription"
- defaults="Your email address is used to log in to your account"
- />
- }
- >
- <ProfileEmailAddress />
- </SettingsSection>
- <hr />
- <SettingsSection
- title={<Trans i18nKey="dangerZone" defaults="Danger Zone" />}
- description={
- <Trans
- i18nKey="dangerZoneAccount"
- defaults="Delete your account permanently. This action cannot be undone."
- />
- }
- >
- <DeleteAccountDialog email={user.email}>
- <DialogTrigger asChild>
- <Button className="text-destructive">
- <TrashIcon className="size-4" />
- <Trans i18nKey="deleteAccount" defaults="Delete Account" />
- </Button>
- </DialogTrigger>
- </DeleteAccountDialog>
- </SettingsSection>
- </SettingsContent>
- </PageContent>
- </PageContainer>
- );
-}
-
-export async function generateMetadata(props: {
- params: Promise<Params>;
-}): Promise<Metadata> {
- const params = await props.params;
- const { t } = await getTranslation(params.locale);
- return {
- title: t("profile"),
- };
-}
diff --git a/apps/web/src/app/[locale]/(space)/account/components/settings-layout.tsx b/apps/web/src/app/[locale]/account/components/settings-layout.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/components/settings-layout.tsx
rename to apps/web/src/app/[locale]/account/components/settings-layout.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/components/sidebar.tsx b/apps/web/src/app/[locale]/account/components/sidebar.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/components/sidebar.tsx
rename to apps/web/src/app/[locale]/account/components/sidebar.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/components/sign-out-button.tsx b/apps/web/src/app/[locale]/account/components/sign-out-button.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/components/sign-out-button.tsx
rename to apps/web/src/app/[locale]/account/components/sign-out-button.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/layout.tsx b/apps/web/src/app/[locale]/account/layout.tsx
similarity index 95%
rename from apps/web/src/app/[locale]/(space)/account/layout.tsx
rename to apps/web/src/app/[locale]/account/layout.tsx
index e5d421e69..20e3e290b 100644
--- a/apps/web/src/app/[locale]/(space)/account/layout.tsx
+++ b/apps/web/src/app/[locale]/account/layout.tsx
@@ -15,8 +15,8 @@ import {
import { ArrowLeftIcon } from "lucide-react";
import Link from "next/link";
import type React from "react";
-import { AccountSidebarMenu } from "@/app/[locale]/(space)/account/components/sidebar";
import { Trans } from "@/components/trans";
+import { AccountSidebarMenu } from "./components/sidebar";
import { SignOutButton } from "./components/sign-out-button";
export default async function ProfileLayout({
diff --git a/apps/web/src/app/[locale]/(space)/account/loading.tsx b/apps/web/src/app/[locale]/account/loading.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/loading.tsx
rename to apps/web/src/app/[locale]/account/loading.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/actions.ts b/apps/web/src/app/[locale]/account/preferences/actions.ts
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/preferences/actions.ts
rename to apps/web/src/app/[locale]/account/preferences/actions.ts
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/components/date-time-preferences.tsx b/apps/web/src/app/[locale]/account/preferences/components/date-time-preferences.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/preferences/components/date-time-preferences.tsx
rename to apps/web/src/app/[locale]/account/preferences/components/date-time-preferences.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/components/language-preference.tsx b/apps/web/src/app/[locale]/account/preferences/components/language-preference.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/preferences/components/language-preference.tsx
rename to apps/web/src/app/[locale]/account/preferences/components/language-preference.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/page.tsx b/apps/web/src/app/[locale]/account/preferences/page.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/preferences/page.tsx
rename to apps/web/src/app/[locale]/account/preferences/page.tsx
diff --git a/apps/web/src/app/[locale]/account/preferences/preferences-page.tsx b/apps/web/src/app/[locale]/account/preferences/preferences-page.tsx
new file mode 100644
index 000000000..acece4620
--- /dev/null
+++ b/apps/web/src/app/[locale]/account/preferences/preferences-page.tsx
@@ -0,0 +1,53 @@
+"use client";
+
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionGroup,
+ PageSectionHeader,
+ PageSectionTitle,
+} from "@/app/components/page-layout";
+import { Trans } from "@/components/trans";
+import { DateTimePreferences } from "./components/date-time-preferences";
+import { LanguagePreference } from "./components/language-preference";
+
+export function PreferencesPage() {
+ return (
+ <PageSectionGroup>
+ <PageSection>
+ <PageSectionHeader>
+ <PageSectionTitle>
+ <Trans i18nKey="language" defaults="Language" />
+ </PageSectionTitle>
+ <PageSectionDescription>
+ <Trans
+ i18nKey="languageDescription"
+ defaults="Change your preferred language"
+ />
+ </PageSectionDescription>
+ </PageSectionHeader>
+ <PageSectionContent>
+ <LanguagePreference />
+ </PageSectionContent>
+ </PageSection>
+
+ <PageSection>
+ <PageSectionHeader>
+ <PageSectionTitle>
+ <Trans i18nKey="dateAndTime" defaults="Date & Time" />
+ </PageSectionTitle>
+ <PageSectionDescription>
+ <Trans
+ i18nKey="dateAndTimeDescription"
+ defaults="Change your preferred date and time settings"
+ />
+ </PageSectionDescription>
+ </PageSectionHeader>
+ <PageSectionContent>
+ <DateTimePreferences />
+ </PageSectionContent>
+ </PageSection>
+ </PageSectionGroup>
+ );
+}
diff --git a/apps/web/src/app/[locale]/(space)/account/profile/actions.ts b/apps/web/src/app/[locale]/account/profile/actions.ts
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/profile/actions.ts
rename to apps/web/src/app/[locale]/account/profile/actions.ts
diff --git a/apps/web/src/app/[locale]/(space)/account/profile/delete-account-dialog.tsx b/apps/web/src/app/[locale]/account/profile/delete-account-dialog.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/profile/delete-account-dialog.tsx
rename to apps/web/src/app/[locale]/account/profile/delete-account-dialog.tsx
diff --git a/apps/web/src/app/[locale]/account/profile/logout-button.tsx b/apps/web/src/app/[locale]/account/profile/logout-button.tsx
new file mode 100644
index 000000000..dd4a54e34
--- /dev/null
+++ b/apps/web/src/app/[locale]/account/profile/logout-button.tsx
@@ -0,0 +1,20 @@
+"use client";
+
+import { Button } from "@rallly/ui/button";
+import { LogOutIcon } from "lucide-react";
+import { signOut } from "next-auth/react";
+import { Trans } from "@/components/trans";
+
+export function LogoutButton() {
+ return (
+ <Button
+ onClick={async () => {
+ await signOut();
+ }}
+ variant="default"
+ >
+ <LogOutIcon className="size-4" />
+ <Trans i18nKey="signOut" defaults="Sign Out" />
+ </Button>
+ );
+}
diff --git a/apps/web/src/app/[locale]/account/profile/page.tsx b/apps/web/src/app/[locale]/account/profile/page.tsx
new file mode 100644
index 000000000..031c1bf0e
--- /dev/null
+++ b/apps/web/src/app/[locale]/account/profile/page.tsx
@@ -0,0 +1,126 @@
+import { Button } from "@rallly/ui/button";
+import { DialogTrigger } from "@rallly/ui/dialog";
+import { TrashIcon } from "lucide-react";
+import type { Metadata } from "next";
+
+import type { Params } from "@/app/[locale]/types";
+import {
+ PageContainer,
+ PageContent,
+ PageHeader,
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionGroup,
+ PageSectionHeader,
+ PageSectionTitle,
+ PageTitle,
+} from "@/app/components/page-layout";
+import { requireUser } from "@/auth/data";
+import { Trans } from "@/components/trans";
+import { getTranslation } from "@/i18n/server";
+import { DeleteAccountDialog } from "./delete-account-dialog";
+import { LogoutButton } from "./logout-button";
+import { ProfileEmailAddress } from "./profile-email-address";
+import { ProfileSettings } from "./profile-settings";
+
+export default async function Page() {
+ const user = await requireUser();
+ return (
+ <PageContainer>
+ <PageHeader>
+ <PageTitle>
+ <Trans i18nKey="profile" defaults="Profile" />
+ </PageTitle>
+ </PageHeader>
+ <PageContent>
+ <PageSectionGroup>
+ <PageSection>
+ <PageSectionHeader>
+ <PageSectionTitle>
+ <Trans i18nKey="profile" defaults="Profile" />
+ </PageSectionTitle>
+ <PageSectionDescription>
+ <Trans
+ i18nKey="profileDescription"
+ defaults="Set your public profile information"
+ />
+ </PageSectionDescription>
+ </PageSectionHeader>
+ <PageSectionContent>
+ <ProfileSettings name={user.name} image={user.image} />
+ </PageSectionContent>
+ </PageSection>
+
+ <PageSection>
+ <PageSectionHeader>
+ <PageSectionTitle>
+ <Trans i18nKey="profileEmailAddress" defaults="Email Address" />
+ </PageSectionTitle>
+ <PageSectionDescription>
+ <Trans
+ i18nKey="profileEmailAddressDescription"
+ defaults="Your email address is used to log in to your account"
+ />
+ </PageSectionDescription>
+ </PageSectionHeader>
+ <PageSectionContent>
+ <ProfileEmailAddress />
+ </PageSectionContent>
+ </PageSection>
+
+ <PageSection>
+ <PageSectionHeader>
+ <PageSectionTitle>
+ <Trans i18nKey="signOutSection" defaults="Sign Out" />
+ </PageSectionTitle>
+ <PageSectionDescription>
+ <Trans
+ i18nKey="signOutSectionDescription"
+ defaults="End your current session and sign out of your account"
+ />
+ </PageSectionDescription>
+ </PageSectionHeader>
+ <PageSectionContent>
+ <LogoutButton />
+ </PageSectionContent>
+ </PageSection>
+
+ <PageSection>
+ <PageSectionHeader>
+ <PageSectionTitle>
+ <Trans i18nKey="dangerZone" defaults="Danger Zone" />
+ </PageSectionTitle>
+ <PageSectionDescription>
+ <Trans
+ i18nKey="dangerZoneAccount"
+ defaults="Delete your account permanently. This action cannot be undone."
+ />
+ </PageSectionDescription>
+ </PageSectionHeader>
+ <PageSectionContent>
+ <DeleteAccountDialog email={user.email}>
+ <DialogTrigger asChild>
+ <Button className="text-destructive">
+ <TrashIcon className="size-4" />
+ <Trans i18nKey="deleteAccount" defaults="Delete Account" />
+ </Button>
+ </DialogTrigger>
+ </DeleteAccountDialog>
+ </PageSectionContent>
+ </PageSection>
+ </PageSectionGroup>
+ </PageContent>
+ </PageContainer>
+ );
+}
+
+export async function generateMetadata(props: {
+ params: Promise<Params>;
+}): Promise<Metadata> {
+ const params = await props.params;
+ const { t } = await getTranslation(params.locale);
+ return {
+ title: t("profile"),
+ };
+}
diff --git a/apps/web/src/app/[locale]/(space)/account/profile/profile-email-address.tsx b/apps/web/src/app/[locale]/account/profile/profile-email-address.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/profile/profile-email-address.tsx
rename to apps/web/src/app/[locale]/account/profile/profile-email-address.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/profile/profile-picture.tsx b/apps/web/src/app/[locale]/account/profile/profile-picture.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/profile/profile-picture.tsx
rename to apps/web/src/app/[locale]/account/profile/profile-picture.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/profile/profile-settings.tsx b/apps/web/src/app/[locale]/account/profile/profile-settings.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/profile/profile-settings.tsx
rename to apps/web/src/app/[locale]/account/profile/profile-settings.tsx
diff --git a/apps/web/src/app/[locale]/(space)/account/settings-menu.tsx b/apps/web/src/app/[locale]/account/settings-menu.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/(space)/account/settings-menu.tsx
rename to apps/web/src/app/[locale]/account/settings-menu.tsx
diff --git a/apps/web/src/app/components/page-layout.tsx b/apps/web/src/app/components/page-layout.tsx
index 1c0c93d94..6afec0378 100644
--- a/apps/web/src/app/components/page-layout.tsx
+++ b/apps/web/src/app/components/page-layout.tsx
@@ -171,7 +171,7 @@ export function PageSectionDescription({
return (
<p
className={cn(
- "mt-2 text-muted-foreground text-sm leading-relaxed",
+ "mt-2 text-pretty text-muted-foreground text-sm leading-relaxed",
className,
)}
>