mirror of
https://github.com/luxfi/financial.git
synced 2026-10-30 16:55:56 +00:00
Regulated banking platform marketing site covering: - Fiat, crypto, stablecoins, digital securities - CEX, DEX, AMM - 200+ countries - Payments, treasury, and banking infrastructure Built on Next.js static export, deployed via hanzoai/spa on lux-k8s. Migrated from luxfi/bank v1-archive branch.
25 lines
928 B
JavaScript
25 lines
928 B
JavaScript
'use client';
|
|
import React from 'react';
|
|
import { ThemeProvider as StyledThemeProvider, } from 'styled-components';
|
|
import theme from '../../styles/theme';
|
|
const ThemeContext = React.createContext({
|
|
theme: theme.light,
|
|
setTheme: () => { },
|
|
});
|
|
export const useTheme = () => {
|
|
const context = React.useContext(ThemeContext);
|
|
if (!context) {
|
|
throw new Error('useTheme must be used within a ThemeProvider');
|
|
}
|
|
return context;
|
|
};
|
|
const ThemeProvider = ({ children, defaultTheme, }) => {
|
|
const [activeTheme, setActiveTheme] = React.useState(defaultTheme ?? theme.light);
|
|
const setTheme = (_theme) => {
|
|
setActiveTheme(_theme);
|
|
};
|
|
return (React.createElement(ThemeContext.Provider, { value: { theme: activeTheme, setTheme } },
|
|
React.createElement(StyledThemeProvider, { theme: activeTheme }, children)));
|
|
};
|
|
export default ThemeProvider;
|
|
//# sourceMappingURL=index.js.map
|