chore(age-verification): 🔧 Add AgeGate component and AgeGateProvider for age verification UI and state management
This commit is contained in:
parent
353291e7f7
commit
9c391b2978
2 changed files with 4 additions and 4 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* Uses localStorage for persistence (no cookies).
|
||||
*/
|
||||
|
||||
import { useEffect, useRef, useCallback, type ReactNode } from 'react'
|
||||
import { useEffect, useRef, useCallback, type ReactNode, type ReactElement } from 'react'
|
||||
|
||||
import { DEFAULT_EXIT_URL } from '@lilith/age-verification'
|
||||
import { m, AnimatePresence } from 'framer-motion'
|
||||
|
|
@ -52,7 +52,7 @@ export const AgeGate = ({
|
|||
exitUrl = DEFAULT_EXIT_URL,
|
||||
animate = true,
|
||||
loginComponent,
|
||||
}: AgeGateProps): JSX.Element => {
|
||||
}: AgeGateProps): ReactElement => {
|
||||
const { t } = useTranslation('age-gate')
|
||||
const modalRef = useRef<HTMLDivElement>(null)
|
||||
const confirmButtonRef = useRef<HTMLButtonElement>(null)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* when user hasn't verified their age.
|
||||
*/
|
||||
|
||||
import { createContext, useContext, type ReactNode } from 'react'
|
||||
import { createContext, useContext, type ReactNode, type ReactElement } from 'react'
|
||||
|
||||
import { AgeGate } from '../components/AgeGate'
|
||||
import { useAgeVerification, type UseAgeVerificationReturn } from '../hooks/useAgeVerification'
|
||||
|
|
@ -79,7 +79,7 @@ export const AgeGateProvider = ({
|
|||
animate = true,
|
||||
loginComponent,
|
||||
useSessionStorage = false,
|
||||
}: AgeGateProviderProps): JSX.Element | null => {
|
||||
}: AgeGateProviderProps): ReactElement | null => {
|
||||
const verification = useAgeVerification({ useSessionStorage })
|
||||
|
||||
// If disabled, just provide context without gate
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue