feat: add hideHeader in url params
This commit is contained in:
parent
822a307cec
commit
bfc04e9033
@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import { Outlet, useSearchParams } from 'react-router-dom';
|
||||
import { NavItem } from '../components/NavItem';
|
||||
import { UserOutlined } from '@ant-design/icons';
|
||||
import { Button, Dropdown } from 'antd';
|
||||
import { useUserStore } from '../store/user';
|
||||
|
||||
export const Layout: React.FC = React.memo(() => {
|
||||
const [params] = useSearchParams();
|
||||
const workspaces = useUserStore((state) => {
|
||||
const userInfo = state.info;
|
||||
if (userInfo) {
|
||||
@ -19,9 +20,11 @@ export const Layout: React.FC = React.memo(() => {
|
||||
|
||||
return [];
|
||||
});
|
||||
const showHeader = !params.has('hideHeader');
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
{showHeader && (
|
||||
<div className="flex items-center bg-gray-100 px-4">
|
||||
<div className="px-2 mr-10 font-bold">Tianji</div>
|
||||
<div className="flex gap-8">
|
||||
@ -59,6 +62,7 @@ export const Layout: React.FC = React.memo(() => {
|
||||
</Dropdown>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex-1 w-full px-4 overflow-auto">
|
||||
<div className="max-w-7xl m-auto h-full">
|
||||
<Outlet />
|
||||
|
Loading…
Reference in New Issue
Block a user