mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-13 07:42:31 +02:00
optimize settings store
This commit is contained in:
@@ -9,8 +9,7 @@ import styles from './main-content.module.css';
|
||||
import { FullScreenOverlay } from '/@/renderer/layouts/default-layout/full-screen-overlay';
|
||||
import { LeftSidebar } from '/@/renderer/layouts/default-layout/left-sidebar';
|
||||
import { RightSidebar } from '/@/renderer/layouts/default-layout/right-sidebar';
|
||||
import { useAppStore, useAppStoreActions } from '/@/renderer/store';
|
||||
import { useGeneralSettings } from '/@/renderer/store/settings.store';
|
||||
import { useAppStore, useAppStoreActions, useSideQueueType } from '/@/renderer/store';
|
||||
import { constrainRightSidebarWidth, constrainSidebarWidth } from '/@/renderer/utils';
|
||||
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||
|
||||
@@ -27,7 +26,7 @@ export const MainContent = ({ shell }: { shell?: boolean }) => {
|
||||
shallow,
|
||||
);
|
||||
const { setSideBar } = useAppStoreActions();
|
||||
const { sideQueueType } = useGeneralSettings();
|
||||
const sideQueueType = useSideQueueType();
|
||||
const [isResizing, setIsResizing] = useState(false);
|
||||
const [isResizingRight, setIsResizingRight] = useState(false);
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ import clsx from 'clsx';
|
||||
import styles from './player-bar.module.css';
|
||||
|
||||
import { Playerbar } from '/@/renderer/features/player/components/playerbar';
|
||||
import { useGeneralSettings } from '/@/renderer/store/settings.store';
|
||||
import { usePlayerbarOpenDrawer } from '/@/renderer/store';
|
||||
|
||||
export const PlayerBar = () => {
|
||||
const { playerbarOpenDrawer } = useGeneralSettings();
|
||||
const playerbarOpenDrawer = usePlayerbarOpenDrawer();
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -4,7 +4,7 @@ import styles from './right-sidebar.module.css';
|
||||
|
||||
import { SidebarPlayQueue } from '/@/renderer/features/now-playing/components/sidebar-play-queue';
|
||||
import { ResizeHandle } from '/@/renderer/features/shared/components/resize-handle';
|
||||
import { useAppStore, useGeneralSettings } from '/@/renderer/store';
|
||||
import { useAppStore, useSideQueueType } from '/@/renderer/store';
|
||||
|
||||
// const queueDrawerVariants: Variants = {
|
||||
// closed: (windowBarStyle) => ({
|
||||
@@ -55,7 +55,7 @@ export const RightSidebar = forwardRef(
|
||||
ref: Ref<HTMLDivElement>,
|
||||
) => {
|
||||
const rightExpanded = useAppStore((state) => state.sidebar.rightExpanded);
|
||||
const { sideQueueType } = useGeneralSettings();
|
||||
const sideQueueType = useSideQueueType();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user