mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 18:26:42 +02:00
style: auto-format codebase with Prettier
Applied formatting to 1487+ files using pnpm format:write - TypeScript/JavaScript files - Svelte components - Astro pages - JSON configs - Markdown docs 13 files still need manual review (Astro JSX comments)
This commit is contained in:
parent
0241f5554c
commit
d36b321d9d
3952 changed files with 661498 additions and 739751 deletions
|
|
@ -3,82 +3,82 @@ import { persist, createJSONStorage } from 'zustand/middleware';
|
|||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
id: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
interface AppState {
|
||||
// User
|
||||
user: User | null;
|
||||
setUser: (user: User | null) => void;
|
||||
// User
|
||||
user: User | null;
|
||||
setUser: (user: User | null) => void;
|
||||
|
||||
// Settings
|
||||
settings: {
|
||||
voice: string;
|
||||
speed: number;
|
||||
theme: 'light' | 'dark';
|
||||
playbackRate: number;
|
||||
};
|
||||
updateSettings: (settings: Partial<AppState['settings']>) => void;
|
||||
// Settings
|
||||
settings: {
|
||||
voice: string;
|
||||
speed: number;
|
||||
theme: 'light' | 'dark';
|
||||
playbackRate: number;
|
||||
};
|
||||
updateSettings: (settings: Partial<AppState['settings']>) => void;
|
||||
|
||||
// Audio Player
|
||||
currentTextId: string | null;
|
||||
isPlaying: boolean;
|
||||
currentPosition: number;
|
||||
setCurrentText: (textId: string | null) => void;
|
||||
setIsPlaying: (playing: boolean) => void;
|
||||
setCurrentPosition: (position: number) => void;
|
||||
// Audio Player
|
||||
currentTextId: string | null;
|
||||
isPlaying: boolean;
|
||||
currentPosition: number;
|
||||
setCurrentText: (textId: string | null) => void;
|
||||
setIsPlaying: (playing: boolean) => void;
|
||||
setCurrentPosition: (position: number) => void;
|
||||
|
||||
// UI State
|
||||
selectedTags: string[];
|
||||
toggleTag: (tag: string) => void;
|
||||
clearTags: () => void;
|
||||
// UI State
|
||||
selectedTags: string[];
|
||||
toggleTag: (tag: string) => void;
|
||||
clearTags: () => void;
|
||||
}
|
||||
|
||||
export const useStore = create<AppState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
// User
|
||||
user: null,
|
||||
setUser: (user) => set({ user }),
|
||||
persist(
|
||||
(set) => ({
|
||||
// User
|
||||
user: null,
|
||||
setUser: (user) => set({ user }),
|
||||
|
||||
// Settings
|
||||
settings: {
|
||||
voice: 'de-DE-Neural2-A',
|
||||
speed: 1.0,
|
||||
theme: 'light',
|
||||
playbackRate: 1.0,
|
||||
},
|
||||
updateSettings: (newSettings) =>
|
||||
set((state) => ({
|
||||
settings: { ...state.settings, ...newSettings },
|
||||
})),
|
||||
// Settings
|
||||
settings: {
|
||||
voice: 'de-DE-Neural2-A',
|
||||
speed: 1.0,
|
||||
theme: 'light',
|
||||
playbackRate: 1.0,
|
||||
},
|
||||
updateSettings: (newSettings) =>
|
||||
set((state) => ({
|
||||
settings: { ...state.settings, ...newSettings },
|
||||
})),
|
||||
|
||||
// Audio Player
|
||||
currentTextId: null,
|
||||
isPlaying: false,
|
||||
currentPosition: 0,
|
||||
setCurrentText: (textId) => set({ currentTextId: textId, currentPosition: 0 }),
|
||||
setIsPlaying: (playing) => set({ isPlaying: playing }),
|
||||
setCurrentPosition: (position) => set({ currentPosition: position }),
|
||||
// Audio Player
|
||||
currentTextId: null,
|
||||
isPlaying: false,
|
||||
currentPosition: 0,
|
||||
setCurrentText: (textId) => set({ currentTextId: textId, currentPosition: 0 }),
|
||||
setIsPlaying: (playing) => set({ isPlaying: playing }),
|
||||
setCurrentPosition: (position) => set({ currentPosition: position }),
|
||||
|
||||
// UI State
|
||||
selectedTags: [],
|
||||
toggleTag: (tag) =>
|
||||
set((state) => ({
|
||||
selectedTags: state.selectedTags.includes(tag)
|
||||
? state.selectedTags.filter((t) => t !== tag)
|
||||
: [...state.selectedTags, tag],
|
||||
})),
|
||||
clearTags: () => set({ selectedTags: [] }),
|
||||
}),
|
||||
{
|
||||
name: 'reader-storage',
|
||||
storage: createJSONStorage(() => AsyncStorage),
|
||||
partialize: (state) => ({
|
||||
settings: state.settings,
|
||||
selectedTags: state.selectedTags,
|
||||
}),
|
||||
}
|
||||
)
|
||||
// UI State
|
||||
selectedTags: [],
|
||||
toggleTag: (tag) =>
|
||||
set((state) => ({
|
||||
selectedTags: state.selectedTags.includes(tag)
|
||||
? state.selectedTags.filter((t) => t !== tag)
|
||||
: [...state.selectedTags, tag],
|
||||
})),
|
||||
clearTags: () => set({ selectedTags: [] }),
|
||||
}),
|
||||
{
|
||||
name: 'reader-storage',
|
||||
storage: createJSONStorage(() => AsyncStorage),
|
||||
partialize: (state) => ({
|
||||
settings: state.settings,
|
||||
selectedTags: state.selectedTags,
|
||||
}),
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue