Add that thing
This commit is contained in:
@@ -51,6 +51,10 @@ export const UserInfoForm = ({
|
|||||||
}: UserInfoFormProps) => {
|
}: UserInfoFormProps) => {
|
||||||
const user = usePreloadedQuery(preloadedUser);
|
const user = usePreloadedQuery(preloadedUser);
|
||||||
const userProvider = usePreloadedQuery(preloadedProvider);
|
const userProvider = usePreloadedQuery(preloadedProvider);
|
||||||
|
const providerMap: Record<string, string> = {
|
||||||
|
unknown: 'Provider',
|
||||||
|
authentik: 'Gib\'s Auth'
|
||||||
|
};
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const updateUser = useMutation(api.auth.updateUser);
|
const updateUser = useMutation(api.auth.updateUser);
|
||||||
@@ -137,16 +141,16 @@ export const UserInfoForm = ({
|
|||||||
{...field}
|
{...field}
|
||||||
type='email'
|
type='email'
|
||||||
placeholder='john@example.com'
|
placeholder='john@example.com'
|
||||||
disabled={userProvider !== 'email'}
|
disabled={userProvider !== 'password'}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
{userProvider === 'email' ? (
|
{userProvider === 'password' ? (
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
Your email address for account notifications
|
Your email address for account notifications
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
) : (
|
) : (
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
Email is managed through your {userProvider} account
|
Email is managed through your {providerMap[userProvider ?? 'unknown']} account
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
)}
|
)}
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -164,3 +168,4 @@ export const UserInfoForm = ({
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user