mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
refactor(orbit,playback): move feature-owned stores (helpModal→orbit; libraryPlaybackHint+playerBarLayout→playback)
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
ListMusic, Inbox, Sliders, LogOut,
|
||||
} from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHelpModalStore } from '@/store/helpModalStore';
|
||||
import { useHelpModalStore } from '@/features/orbit/store/helpModalStore';
|
||||
import { SettingsSubSection } from '@/features/settings';
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react';
|
||||
import { X, RefreshCw, Shuffle, Settings2, Share2, HelpCircle, Activity } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useOrbitStore } from '@/features/orbit/store/orbitStore';
|
||||
import { useHelpModalStore } from '@/store/helpModalStore';
|
||||
import { useHelpModalStore } from '@/features/orbit/store/helpModalStore';
|
||||
import { usePlayerStore } from '@/features/playback/store/playerStore';
|
||||
import {
|
||||
endOrbitSession,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Orbit as OrbitIcon, Plus, LogIn, HelpCircle } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useOrbitStore } from '@/features/orbit/store/orbitStore';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useHelpModalStore } from '@/store/helpModalStore';
|
||||
import { useHelpModalStore } from '@/features/orbit/store/helpModalStore';
|
||||
import OrbitStartModal from '@/features/orbit/components/OrbitStartModal';
|
||||
import OrbitJoinModal from '@/features/orbit/components/OrbitJoinModal';
|
||||
import OrbitWordmark from '@/features/orbit/components/OrbitWordmark';
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface HelpModalStore {
|
||||
isOpen: boolean;
|
||||
open: () => void;
|
||||
close: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* App-wide toggle for the Orbit help modal. Two triggers — the launch
|
||||
* popover "How does this work?" entry and the in-session bar help button
|
||||
* — write to the same store so they share the one rendered modal. Not
|
||||
* persisted; resets to closed on reload.
|
||||
*/
|
||||
export const useHelpModalStore = create<HelpModalStore>(set => ({
|
||||
isOpen: false,
|
||||
open: () => set({ isOpen: true }),
|
||||
close: () => set({ isOpen: false }),
|
||||
}));
|
||||
Reference in New Issue
Block a user