UNPKG

@oxyhq/services

Version:

OxyHQ Expo/React Native SDK — UI components, screens, and native features

29 lines (28 loc) 811 B
"use strict"; import React, { createContext, useContext } from 'react'; import { jsx as _jsx } from "react/jsx-runtime"; export const ThemeContext = /*#__PURE__*/createContext(undefined); /** * ThemeProvider component that accepts a theme prop and provides it via context. * This allows Accounts-style components to access theme through hooks. */ export function ThemeProvider({ theme, children }) { return /*#__PURE__*/_jsx(ThemeContext.Provider, { value: { resolvedTheme: theme, isLoaded: true }, children: children }); } export function useThemeContext() { const context = useContext(ThemeContext); if (context === undefined) { throw new Error('useThemeContext must be used within a ThemeProvider'); } return context; } //# sourceMappingURL=ThemeContext.js.map