芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/resources/js/Admin/Layouts/AdminLayouts.jsx
import Header from "@/Admin/Components/Header/index.jsx"; import Sidebar from "@/Admin/Components/Sidebar/Index.jsx"; import Footer from "@/Admin/Components/Footer/Index.jsx"; import toast, { Toaster } from 'react-hot-toast'; import {useEffect} from "react"; import {usePage} from "@inertiajs/react"; import { updateContact, updateFooter, updateGeneral, updateSidebar, updateSocialLink, updateSubscribe } from "@/Redux/features/pages/Customize/customize"; import {useDispatch} from "react-redux"; export default function AdminLayouts({ children }){ const { props } = usePage(); const customizeSettings = window.customize_settings; const dispatch = useDispatch() // show toast notification useEffect(() => { if (props.flash.success){ toast.success(props.flash.success, { duration: 3000, }) } else if (props.flash.error){ toast.error(props.flash.error, { duration: 3000, }) } }, [props.flash]) // update customize settings useEffect(() => { if (customizeSettings){ dispatch(updateGeneral(customizeSettings.general)) dispatch(updateSidebar(customizeSettings.sidebar)) dispatch(updateFooter(customizeSettings.footer)) dispatch(updateContact(customizeSettings.contact)) dispatch(updateSubscribe(customizeSettings.subscriber)) dispatch(updateSocialLink(customizeSettings.social_links)) } }, [customizeSettings]) return ( <>
{children}
> ) }