diff options
| author | Fuwn <[email protected]> | 2026-01-24 13:09:50 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-24 13:09:50 +0000 |
| commit | 396acf3bbbe00a192cb0ea0a9ccf91b1d8d2850b (patch) | |
| tree | b9df4ca6a70db45cfffbae6fdd7252e20fb8e93c /src/app/(main)/teams/TeamsJoinButton.tsx | |
| download | umami-main.tar.xz umami-main.zip | |
Created from https://vercel.com/new
Diffstat (limited to 'src/app/(main)/teams/TeamsJoinButton.tsx')
| -rw-r--r-- | src/app/(main)/teams/TeamsJoinButton.tsx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/app/(main)/teams/TeamsJoinButton.tsx b/src/app/(main)/teams/TeamsJoinButton.tsx new file mode 100644 index 0000000..017211e --- /dev/null +++ b/src/app/(main)/teams/TeamsJoinButton.tsx @@ -0,0 +1,31 @@ +import { Button, Dialog, DialogTrigger, Icon, Modal, Text, useToast } from '@umami/react-zen'; +import { useMessages, useModified } from '@/components/hooks'; +import { UserPlus } from '@/components/icons'; +import { TeamJoinForm } from './TeamJoinForm'; + +export function TeamsJoinButton() { + const { formatMessage, labels, messages } = useMessages(); + const { toast } = useToast(); + const { touch } = useModified(); + + const handleJoin = () => { + toast(formatMessage(messages.saved)); + touch('teams'); + }; + + return ( + <DialogTrigger> + <Button> + <Icon> + <UserPlus /> + </Icon> + <Text>{formatMessage(labels.joinTeam)}</Text> + </Button> + <Modal> + <Dialog title={formatMessage(labels.joinTeam)} style={{ width: 400 }}> + {({ close }) => <TeamJoinForm onSave={handleJoin} onClose={close} />} + </Dialog> + </Modal> + </DialogTrigger> + ); +} |