import React, { PropsWithChildren, useEffect } from 'react' import { useTheme } from 'next-themes' import { motion as m } from 'framer-motion' import BottomBar from '@/containers/Layout/BottomBar' import RibbonNav from '@/containers/Layout/Ribbon' import TopBar from '@/containers/Layout/TopBar' import { MainViewState } from '@/constants/screens' import { useMainViewState } from '@/hooks/useMainViewState' import { SUCCESS_SET_NEW_DESTINATION } from '@/hooks/useVaultDirectory' const BaseLayout = (props: PropsWithChildren) => { const { children } = props const { mainViewState, setMainViewState } = useMainViewState() const { theme, setTheme } = useTheme() useEffect(() => { setTheme(theme as string) }, [setTheme, theme]) useEffect(() => { if (localStorage.getItem(SUCCESS_SET_NEW_DESTINATION) === 'true') { setMainViewState(MainViewState.Settings) localStorage.removeItem(SUCCESS_SET_NEW_DESTINATION) } }, [setMainViewState]) return (
{children}
) } export default BaseLayout