diff --git a/.changeset/happy-eggs-buy.md b/.changeset/happy-eggs-buy.md new file mode 100644 index 000000000..c498c1553 --- /dev/null +++ b/.changeset/happy-eggs-buy.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": minor +--- + +add change password for logged-in customer diff --git a/apps/core/app/[locale]/(default)/account/[tab]/_components/account-settings-form.tsx b/apps/core/app/[locale]/(default)/account/[tab]/_components/account-settings-form.tsx new file mode 100644 index 000000000..e080e78df --- /dev/null +++ b/apps/core/app/[locale]/(default)/account/[tab]/_components/account-settings-form.tsx @@ -0,0 +1,103 @@ +'use client'; + +import { Button } from '@bigcommerce/components/button'; +import { Field, FieldControl, FieldLabel, Form, FormSubmit } from '@bigcommerce/components/form'; +import { Input } from '@bigcommerce/components/input'; +import { Loader2 as Spinner } from 'lucide-react'; +import { useTranslations } from 'next-intl'; +import { useFormStatus } from 'react-dom'; + +import { Link } from '~/components/link'; + +const SubmitButton = () => { + const { pending } = useFormStatus(); + const t = useTranslations('SubmitAccountSettings'); + + return ( + + ); +}; + +export const AccountSettingsForm = () => { + const t = useTranslations('Account.AccountSettings'); + + return ( +
+ ); +}; diff --git a/apps/core/app/[locale]/(default)/account/[tab]/page.tsx b/apps/core/app/[locale]/(default)/account/[tab]/page.tsx index 42224cbe0..47b1121e3 100644 --- a/apps/core/app/[locale]/(default)/account/[tab]/page.tsx +++ b/apps/core/app/[locale]/(default)/account/[tab]/page.tsx @@ -3,9 +3,10 @@ import { notFound } from 'next/navigation'; import { NextIntlClientProvider } from 'next-intl'; import { getMessages, getTranslations } from 'next-intl/server'; -import { Link } from '~/components/link'; import { LocaleType } from '~/i18n'; +import { AccountSettingsForm as FormPlaceholder } from './_components/account-settings-form'; + interface Props { params: { tab: 'orders' | 'messages' | 'addresses' | 'wishlists' | 'recently-viewed' | 'settings'; @@ -19,59 +20,6 @@ export function generateMetadata({ params: { tab } }: Props): Metadata { }; } -const FormPlaceholder = () => ( -