Updated edit permissions on settings components.

This commit is contained in:
Mike Cao 2025-09-19 17:58:52 -07:00
parent ffc8f6faae
commit 7effa16f00
15 changed files with 128 additions and 148 deletions

View file

@ -6,12 +6,11 @@ import {
Button,
FormSubmitButton,
} from '@umami/react-zen';
import { useMessages, useModified, useUpdateQuery } from '@/components/hooks';
import { useMessages, useUpdateQuery } from '@/components/hooks';
export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
const { formatMessage, labels, getErrorMessage } = useMessages();
const { mutate, error } = useUpdateQuery('/teams/join');
const { touch } = useModified();
const { mutate, error, isPending, touch } = useUpdateQuery('/teams/join');
const handleSubmit = async (data: any) => {
mutate(data, {
@ -34,7 +33,9 @@ export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose:
</FormField>
<FormButtons>
<Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>
<FormSubmitButton variant="primary">{formatMessage(labels.join)}</FormSubmitButton>
<FormSubmitButton variant="primary" isLoading={isPending} isDisabled={isPending}>
{formatMessage(labels.join)}
</FormSubmitButton>
</FormButtons>
</Form>
);