feat: Initial Material You client implementation
Implemented a Material You (Material 3) client for the bonch-open-api. - Added API client with axios - Added Zustand store for API config and user data - Added Login and Profile pages - Set up routing with react-router-dom - Added global styles with Material 3 tokens Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
25
src/store/useStore.ts
Normal file
25
src/store/useStore.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
|
||||
interface AppState {
|
||||
apiDomain: string;
|
||||
apiKey: string;
|
||||
setApiDomain: (domain: string) => void;
|
||||
setApiKey: (key: string) => void;
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
export const useStore = create<AppState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
apiDomain: import.meta.env.VITE_API_DOMAIN || '',
|
||||
apiKey: '',
|
||||
setApiDomain: (apiDomain) => set({ apiDomain }),
|
||||
setApiKey: (apiKey) => set({ apiKey }),
|
||||
reset: () => set({ apiKey: '' }),
|
||||
}),
|
||||
{
|
||||
name: 'bonch-md-storage',
|
||||
}
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user