-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e55d5b
commit ec9f94c
Showing
3 changed files
with
45 additions
and
20 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
21 changes: 21 additions & 0 deletions
21
packages/twenty-front/src/modules/billing/hooks/useFreePass.ts
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 { freePassState } from '@/billing/states/freePassState'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { useRecoilState } from 'recoil'; | ||
|
||
export const useFreePass = () => { | ||
const { search } = useLocation(); | ||
const [freePass, setFreePass] = useRecoilState(freePassState); | ||
|
||
const hasFreePassParameter = | ||
search.includes('freepass') || | ||
search.includes('freePass') || | ||
search.includes('free-pass') || | ||
search.includes('Free-pass') || | ||
search.includes('FreePass'); | ||
|
||
if (hasFreePassParameter) { | ||
setFreePass(true); | ||
} | ||
|
||
return freePass; | ||
}; |