2024-01-23 12:19:22 +00:00
|
|
|
import { FC, ReactNode } from "react";
|
|
|
|
// layout
|
2024-03-19 14:38:35 +00:00
|
|
|
import { SidebarHamburgerToggle } from "@/components/core/sidebar/sidebar-menu-hamburger-toggle";
|
2024-04-29 07:29:49 +00:00
|
|
|
import { PreferencesMobileHeader } from "@/components/profile/preferences/preferences-mobile-header";
|
2024-04-30 09:28:49 +00:00
|
|
|
import { useAppTheme } from "@/hooks/store";
|
2024-03-19 14:38:35 +00:00
|
|
|
import { ProfileSettingsLayout } from "@/layouts/settings-layout";
|
2024-04-29 06:42:33 +00:00
|
|
|
// local components
|
2024-03-06 13:09:14 +00:00
|
|
|
import { ProfilePreferenceSettingsSidebar } from "./sidebar";
|
2024-01-23 12:19:22 +00:00
|
|
|
|
|
|
|
interface IProfilePreferenceSettingsLayout {
|
|
|
|
children: ReactNode;
|
|
|
|
header?: ReactNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const ProfilePreferenceSettingsLayout: FC<IProfilePreferenceSettingsLayout> = (props) => {
|
|
|
|
const { children, header } = props;
|
2024-04-30 09:28:49 +00:00
|
|
|
const { toggleSidebar } = useAppTheme();
|
2024-01-23 12:19:22 +00:00
|
|
|
|
|
|
|
return (
|
2024-02-16 14:37:04 +00:00
|
|
|
<ProfileSettingsLayout
|
|
|
|
header={
|
|
|
|
<div className="md:hidden flex flex-shrink-0 gap-4 items-center justify-start border-b border-custom-border-200 p-4">
|
2024-04-30 09:28:49 +00:00
|
|
|
<SidebarHamburgerToggle onClick={toggleSidebar} />
|
2024-02-16 14:37:04 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
>
|
2024-04-29 07:29:49 +00:00
|
|
|
<div className="h-full">
|
|
|
|
<PreferencesMobileHeader />
|
|
|
|
<div className="relative flex h-full w-full overflow-hidden">
|
|
|
|
<ProfilePreferenceSettingsSidebar />
|
|
|
|
<main className="relative flex h-full w-full flex-col overflow-hidden bg-custom-background-100">
|
|
|
|
{header}
|
|
|
|
<div className="h-full w-full">{children}</div>
|
|
|
|
</main>
|
|
|
|
</div>
|
2024-01-23 12:19:22 +00:00
|
|
|
</div>
|
|
|
|
</ProfileSettingsLayout>
|
|
|
|
);
|
|
|
|
};
|