-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30664 from Expensify/marcaaron-setLastOfferedFocu…
…sMode Update users to focus mode automatically if they have the minimum report number
- Loading branch information
Showing
13 changed files
with
305 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.