Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
function ThemeProvider(props: ThemeProviderProps): Element;
props
ThemeProviderProps
Element
const AuthBasedTheme = ({ children }: { children: React.ReactNode }) => { const { isSignedIn: signedIn } = useIsSignedIn(); const { evmAddress: cdpEvmAddress } = useEvmAddress(); const isAuthenticated = signedIn && cdpEvmAddress; const theme = useMemo(() => (isAuthenticated ? darkTheme : {}), [isAuthenticated]); return ( <ThemeProvider theme={theme}> {children} </ThemeProvider> ); }; function App() { // Change the theme based on the user's authentication status return ( <CDPHooksProvider config={cdpConfig}> <AuthBasedTheme> <YourApp /> </AuthBasedTheme> </CDPHooksProvider> ); }
Was this page helpful?