mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 18:45:36 +01:00
Use context hooks.
This commit is contained in:
parent
00adb00d2d
commit
600a3d28c3
13 changed files with 46 additions and 44 deletions
|
|
@ -8,9 +8,7 @@ import {
|
|||
useToast,
|
||||
} from '@umami/react-zen';
|
||||
import { getRandomChars } from '@/lib/crypto';
|
||||
import { useContext } from 'react';
|
||||
import { useApi, useMessages, useModified } from '@/components/hooks';
|
||||
import { TeamContext } from '@/app/(main)/teams/TeamProvider';
|
||||
import { useApi, useMessages, useModified, useTeam } from '@/components/hooks';
|
||||
|
||||
const generateId = () => `team_${getRandomChars(16)}`;
|
||||
|
||||
|
|
@ -23,7 +21,7 @@ export function TeamEditForm({
|
|||
allowEdit?: boolean;
|
||||
onSave?: () => void;
|
||||
}) {
|
||||
const team = useContext(TeamContext);
|
||||
const team = useTeam();
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { post, useMutation } = useApi();
|
||||
const { toast } = useToast();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue