From 1bd13aab979569b93d5602f562bc9e31112e26dd Mon Sep 17 00:00:00 2001 From: goodmice Date: Tue, 19 Oct 2021 14:50:32 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=B4=20LayoutPortal=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BA=D0=BE=D1=80=D0=B0=D1=89=D1=91=D0=BD=20=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LayoutPortal.jsx | 27 ++++++++++----------------- src/pages/Main.jsx | 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/components/LayoutPortal.jsx b/src/components/LayoutPortal.jsx index d6cc868..2fa6886 100644 --- a/src/components/LayoutPortal.jsx +++ b/src/components/LayoutPortal.jsx @@ -1,20 +1,13 @@ import {Layout} from 'antd' import PageHeader from './PageHeader' -const {Content} = Layout - -export default function LayoutPortal({title, noSheet, children}) { - const content = noSheet - ? {children} - : - - {children} - - - - return ( - - - {content} - ) -} \ No newline at end of file +export const LayoutPortal = ({title, noSheet, ...props}) => ( + + + + {noSheet ? props.children : ( + + )} + + +) diff --git a/src/pages/Main.jsx b/src/pages/Main.jsx index e4edbe8..3d58707 100644 --- a/src/pages/Main.jsx +++ b/src/pages/Main.jsx @@ -2,7 +2,7 @@ import { Redirect, Route, Switch } from "react-router-dom"; import Deposit from "./Deposit"; import Cluster from "./Cluster"; import Well from "./Well"; -import LayoutPortal from "../components/LayoutPortal"; +import {LayoutPortal} from "../components/LayoutPortal"; export default function Main() { return (