Admin: add menu to layout

This commit is contained in:
vchikalkin 2024-04-10 14:09:57 +03:00
parent b75bd8ee14
commit 8762b0bf46
3 changed files with 50 additions and 13 deletions

View File

@ -17,6 +17,10 @@ type QueryProps = {
const StyledPre = styled.pre`
max-height: 300px;
overflow-y: auto;
${min('desktop')} {
max-height: 800px;
}
`;
const Query = memo(({ handleDeleteQuery, queryKey }: QueryProps) => {
@ -91,7 +95,7 @@ const QueryList = memo(({ queries }: QueryListProps) => {
const Wrapper = styled(Background)`
padding: 4px 6px;
width: 100%;
width: 100vw;
${min('tablet')} {
min-height: 790px;
@ -99,7 +103,7 @@ const Wrapper = styled(Background)`
${min('laptop')} {
padding: 4px 18px 10px;
width: 1024px;
width: unset;
}
`;

View File

@ -1,18 +1,50 @@
import { min } from '@/styles/mq';
import type { MenuProps } from 'antd';
import type { PropsWithChildren } from 'react';
import styled from 'styled-components';
import { Box } from 'ui/grid';
import { Menu } from 'ui/elements';
import { DatabaseOutlined, HomeOutlined } from 'ui/elements/icons';
import { Flex } from 'ui/grid';
export const Layout = styled(Box)`
display: flex;
flex-direction: column;
gap: 10px;
const items: MenuProps['items'] = [
{
disabled: true,
icon: <HomeOutlined />,
key: 'home',
label: 'Главная',
},
{
icon: <DatabaseOutlined />,
key: 'cache-control',
label: 'Управление кэшем',
},
];
const Wrapper = styled.div`
${min('laptop')} {
display: grid;
place-items: center;
}
${min('desktop-xl')} {
margin: 8px 10% !important;
height: calc(100vh - var(--height-header));
overflow-y: scroll;
}
`;
const MenuWrapper = styled(Wrapper)`
> :first-child {
min-height: 100%;
width: 280px;
}
`;
const ContentWrapper = styled(Wrapper)`
flex: 1;
`;
export function Layout({ children }: PropsWithChildren) {
return (
<Flex>
<MenuWrapper>
<Menu mode="inline" items={items} />
</MenuWrapper>
<ContentWrapper>{children}</ContentWrapper>
</Flex>
);
}

View File

@ -15,6 +15,7 @@ export {
Divider,
Form,
InputNumber,
Menu,
message,
notification,
Result,