Migrate integrations to widgets

This commit is contained in:
Meierschlumpf
2022-12-18 21:21:23 +01:00
parent 7cb71eba84
commit e914174e78
14 changed files with 247 additions and 120 deletions

View File

@@ -2,6 +2,7 @@ import { Group, Stack } from '@mantine/core';
import { useMemo } from 'react';
import { useConfigContext } from '../../../config/provider';
import { useScreenLargerThan } from '../../../tools/hooks/useScreenLargerThan';
import { useScreenSmallerThan } from '../../../tools/hooks/useScreenSmallerThan';
import { CategoryType } from '../../../types/category';
import { WrapperType } from '../../../types/wrapper';
import { DashboardCategory } from '../Wrappers/Category/Category';
@@ -11,11 +12,11 @@ import { DashboardWrapper } from '../Wrappers/Wrapper/Wrapper';
export const DashboardView = () => {
const wrappers = useWrapperItems();
const layoutSettings = useConfigContext()?.config?.settings.customization.layout;
const showSidebars = useScreenLargerThan('md');
const doNotShowSidebar = useScreenSmallerThan('md');
return (
<Group align="top" h="100%">
{layoutSettings?.enabledLeftSidebar && showSidebars ? (
{layoutSettings?.enabledLeftSidebar && !doNotShowSidebar ? (
<DashboardSidebar location="left" />
) : null}
<Stack mx={-10} style={{ flexGrow: 1 }}>
@@ -27,7 +28,7 @@ export const DashboardView = () => {
)
)}
</Stack>
{layoutSettings?.enabledRightSidebar && showSidebars ? (
{layoutSettings?.enabledRightSidebar && !doNotShowSidebar ? (
<DashboardSidebar location="right" />
) : null}
</Group>