-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
/
Copy pathindex.tsx
65 lines (52 loc) · 1.8 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use client';
import { ArrowUpRightIcon, XMarkIcon } from '@heroicons/react/24/outline';
import * as Dialog from '@radix-ui/react-dialog';
import { useTranslations } from 'next-intl';
import type { FC, PropsWithChildren, ComponentProps } from 'react';
import AvatarGroup from '@/components/Common/AvatarGroup';
import Link from '@/components/Link';
import styles from './index.module.css';
type ChangelogModalProps = PropsWithChildren<{
heading: string;
subheading: string;
avatars: ComponentProps<typeof AvatarGroup>['avatars'];
open?: boolean;
onOpenChange?: (open: boolean) => void;
}>;
const ChangelogModal: FC<ChangelogModalProps> = ({
heading,
subheading,
avatars,
children,
open = false,
onOpenChange = () => {},
}) => {
const t = useTranslations();
return (
<Dialog.Root open={open} onOpenChange={onOpenChange}>
<Dialog.Portal>
<Dialog.Overlay className={styles.overlay}>
<Dialog.Content className={styles.content}>
<Dialog.Trigger className={styles.close}>
<XMarkIcon />
</Dialog.Trigger>
<Dialog.Title className={styles.title}>{heading}</Dialog.Title>
<Dialog.Description className={styles.description}>
{subheading}
</Dialog.Description>
<div className={styles.authors}>
<AvatarGroup avatars={avatars} isExpandable={false} />
<Link href="/about/get-involved">
{t('components.downloads.changelogModal.startContributing')}
<ArrowUpRightIcon />
</Link>
</div>
<div className={styles.wrapper}>{children}</div>
<Dialog.Close />
</Dialog.Content>
</Dialog.Overlay>
</Dialog.Portal>
</Dialog.Root>
);
};
export default ChangelogModal;