From d0f677a6e93515bf5a573cc5b8a1420961e9b016 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 17 Jan 2022 23:03:51 +0800 Subject: [PATCH] feat: add admin layout --- .../route-switch/antd/admin-layout/index.tsx | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/packages/client/src/route-switch/antd/admin-layout/index.tsx b/packages/client/src/route-switch/antd/admin-layout/index.tsx index 4f25c67ab..f9a6f258d 100644 --- a/packages/client/src/route-switch/antd/admin-layout/index.tsx +++ b/packages/client/src/route-switch/antd/admin-layout/index.tsx @@ -1,13 +1,31 @@ -import { Table } from 'antd'; -import React from 'react'; +import React, { useState } from 'react'; +import { Layout, Spin } from 'antd'; +import { useRoute } from '../..'; +import { RemoteSchemaComponent } from '../../../schema-component'; +import { useHistory, useRouteMatch } from 'react-router-dom'; export function AdminLayout(props: any) { - + const route = useRoute(); + const history = useHistory(); + const match = useRouteMatch(); + const defaultSelectedUid = match.params.name; + const [schema, setSchema] = useState({}); + const onSelect = ({ item }) => { + const schema = item.props.schema; + setSchema(schema); + history.push(`/admin/${schema['x-uid']}`); + }; return ( -
- - AdminLayout - + + + + + + + + + + ); }