Convert useModified into a real hook.

This commit is contained in:
Mike Cao 2024-02-07 23:48:51 -08:00
parent a426c242cb
commit 91e3dff7f5
24 changed files with 63 additions and 48 deletions

View file

@ -1,7 +1,6 @@
import { useLocale, useLogin, useMessages } from 'components/hooks';
import { useLocale, useLogin, useMessages, useModified } from 'components/hooks';
import { useRouter } from 'next/navigation';
import { Button, Icon, Icons, Modal, ModalTrigger, Text } from 'react-basics';
import { touch } from 'store/modified';
import TeamDeleteForm from './TeamLeaveForm';
export function TeamLeaveButton({ teamId, teamName }: { teamId: string; teamName: string }) {
@ -9,6 +8,7 @@ export function TeamLeaveButton({ teamId, teamName }: { teamId: string; teamName
const router = useRouter();
const { dir } = useLocale();
const { user } = useLogin();
const { touch } = useModified();
const handleLeave = async () => {
touch('teams');