-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathPostFlow.EditedDraftModal.tsx
More file actions
45 lines (42 loc) · 1.36 KB
/
PostFlow.EditedDraftModal.tsx
File metadata and controls
45 lines (42 loc) · 1.36 KB
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
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { Trans } from '@lingui/react/macro';
import { RegenModalProps } from 'web-components/src/components/modal';
import { SadBeeModal } from 'web-components/src/components/modal/SadBeeModal/SadBeeModal';
import { CancelButtonFooter } from 'web-components/src/components/organisms/CancelButtonFooter/CancelButtonFooter';
import { Body, Title } from 'web-components/src/components/typography';
type EditedDraftModalProps = {
onCancel: () => void;
onSubmit: () => void;
shouldSaveDraft: boolean;
} & RegenModalProps;
export const EditedDraftModal = ({
onCancel,
onSubmit,
open,
onClose,
shouldSaveDraft,
}: EditedDraftModalProps) => {
const { _ } = useLingui();
return (
<SadBeeModal open={open} onClose={onClose}>
<Title variant="h4" className="text-center my-20">
<Trans>
Someone made changes to this draft while you were editing.
</Trans>
</Title>
<Body size="lg" className="text-center mb-50">
<Trans>You will overwrite their changes if you continue.</Trans>
</Body>
<CancelButtonFooter
label={
shouldSaveDraft
? _(msg`overwrite & save`)
: _(msg`overwrite & publish`)
}
onCancel={onCancel}
onClick={onSubmit}
/>
</SadBeeModal>
);
};