-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 #19498 from Expensify/Rory-HookySignInPage
Migrate SignInPage to functional component
- Loading branch information
Showing
6 changed files
with
158 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {useContext} from 'react'; | ||
import {LocaleContext} from '../components/withLocalize'; | ||
|
||
export default function useLocalize() { | ||
return useContext(LocaleContext); | ||
} |
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,21 @@ | ||
import _ from 'underscore'; | ||
import {useContext, useMemo} from 'react'; | ||
import Permissions from '../libs/Permissions'; | ||
import {BetasContext} from '../components/OnyxProvider'; | ||
|
||
export default function usePermissions() { | ||
const betas = useContext(BetasContext); | ||
return useMemo( | ||
() => | ||
_.reduce( | ||
Permissions, | ||
(memo, checkerFunction, beta) => { | ||
// eslint-disable-next-line no-param-reassign | ||
memo[beta] = checkerFunction(betas); | ||
return memo; | ||
}, | ||
{}, | ||
), | ||
[betas], | ||
); | ||
} |
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