-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Farzin/87456/Extract
is_onramp_tab_visible
method from cashier `OnR…
…ampStore` to reusable hook (#7475) * feat(core): ✨ add `is_crypto` method to `ClientStore` * feat(hooks): ✨ add `useOnrampVisible` hook * refactor(cashier): ♻️ replace `is_onramp_tab_visible` with `useOnrampVisible` * refactor(core): ♻️ replace `is_onramp_tab_visible` with `useOnrampVisible` * docs(cashier): 🗑️ deprecated legacy `is_onramp_tab_visible` method --------- Co-authored-by: Farzin Mirzaie <farzin@deriv.com>
- Loading branch information
1 parent
055373f
commit 3d1e7da
Showing
8 changed files
with
32 additions
and
29 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
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,11 @@ | ||
import { useStore } from '@deriv/stores'; | ||
|
||
const useOnrampVisible = () => { | ||
const { client } = useStore(); | ||
const { is_virtual, is_crypto } = client; | ||
const is_onramp_visible = !is_virtual && is_crypto; | ||
|
||
return is_onramp_visible; | ||
}; | ||
|
||
export default useOnrampVisible; |
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