This commit updates the naming convention of icons from Lucide-React, moving some package dependencies to "peerDependencies" in 'team-accounts', 'admin' and 'auth'. Additionally, it includes tweaks to the development server command in apps/web package.json and adds a logger reference to the shared package. Furthermore, cleanup work has been performed within the features and UI packages, and new scripts to interact with Stripe have been added to the root package.json.
39 lines
928 B
TypeScript
39 lines
928 B
TypeScript
'use client';
|
|
|
|
import { useUser } from '@kit/supabase/hooks/use-user';
|
|
import { Alert } from '@kit/ui/alert';
|
|
import { LoadingOverlay } from '@kit/ui/loading-overlay';
|
|
import { Trans } from '@kit/ui/trans';
|
|
|
|
import { UpdatePasswordForm } from './update-password-form';
|
|
|
|
export function UpdatePasswordFormContainer(
|
|
props: React.PropsWithChildren<{
|
|
callbackPath: string;
|
|
}>,
|
|
) {
|
|
const { data: user, isPending } = useUser();
|
|
|
|
if (isPending) {
|
|
return <LoadingOverlay fullPage={false} />;
|
|
}
|
|
|
|
const canUpdatePassword = user.identities?.some(
|
|
(item) => item.provider === `email`,
|
|
);
|
|
|
|
if (!canUpdatePassword) {
|
|
return <WarnCannotUpdatePasswordAlert />;
|
|
}
|
|
|
|
return <UpdatePasswordForm callbackPath={props.callbackPath} user={user} />;
|
|
}
|
|
|
|
function WarnCannotUpdatePasswordAlert() {
|
|
return (
|
|
<Alert variant={'warning'}>
|
|
<Trans i18nKey={'profile:cannotUpdatePassword'} />
|
|
</Alert>
|
|
);
|
|
}
|