-
Notifications
You must be signed in to change notification settings - Fork 3k
/
FocusModeNotification.js
47 lines (45 loc) · 1.65 KB
/
FocusModeNotification.js
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
import React, {useEffect} from 'react';
import useEnvironment from '@hooks/useEnvironment';
import useLocalize from '@hooks/useLocalize';
import styles from '@styles/styles';
import * as Link from '@userActions/Link';
import * as User from '@userActions/User';
import CONST from '@src/CONST';
import ConfirmModal from './ConfirmModal';
import Text from './Text';
import TextLinkWithRef from './TextLink';
function FocusModeNotification() {
const {environmentURL} = useEnvironment();
const {translate} = useLocalize();
useEffect(() => {
User.updateChatPriorityMode(CONST.PRIORITY_MODE.GSD, true);
}, []);
const href = `${environmentURL}/settings/preferences/priority-mode`;
return (
<ConfirmModal
title={translate('focusModeUpdateModal.title')}
confirmText={translate('common.buttonConfirm')}
onConfirm={User.clearFocusModeNotification}
shouldShowCancelButton={false}
prompt={
<Text>
{translate('focusModeUpdateModal.prompt')}
<TextLinkWithRef
href={href}
style={styles.link}
onPress={() => {
User.clearFocusModeNotification();
Link.openLink(href, environmentURL);
}}
>
{translate('common.here')}
</TextLinkWithRef>
.
</Text>
}
isVisible
/>
);
}
FocusModeNotification.displayName = 'FocusModeNotification';
export default FocusModeNotification;