From 4d9fdeb391df333fddadc6584d6a37b598827f5c Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Tue, 15 Mar 2022 13:22:07 +0800 Subject: [PATCH] refactor(console): update per review --- packages/console/src/App.tsx | 2 +- .../AppContent/components/Content/index.module.scss | 3 --- .../AppContent/components/Content/index.tsx | 13 ------------- .../src/components/AppContent/index.module.scss | 4 ++++ .../console/src/components/AppContent/index.tsx | 5 ++--- .../src/{components => pages}/Callback/index.tsx | 0 6 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 packages/console/src/components/AppContent/components/Content/index.module.scss delete mode 100644 packages/console/src/components/AppContent/components/Content/index.tsx rename packages/console/src/{components => pages}/Callback/index.tsx (100%) diff --git a/packages/console/src/App.tsx b/packages/console/src/App.tsx index f63498095..2a7e8c1a6 100644 --- a/packages/console/src/App.tsx +++ b/packages/console/src/App.tsx @@ -6,13 +6,13 @@ import './scss/normalized.scss'; import AppContent from './components/AppContent'; import { getPath, sections } from './components/AppContent/components/Sidebar'; -import Callback from './components/Callback'; import Toast from './components/Toast'; import initI18n from './i18n/init'; import ApiResourceDetails from './pages/ApiResourceDetails'; import ApiResources from './pages/ApiResources'; import ApplicationDetails from './pages/ApplicationDetails'; import Applications from './pages/Applications'; +import Callback from './pages/Callback'; import ConnectorDetails from './pages/ConnectorDetails'; import Connectors from './pages/Connectors'; import GetStarted from './pages/GetStarted'; diff --git a/packages/console/src/components/AppContent/components/Content/index.module.scss b/packages/console/src/components/AppContent/components/Content/index.module.scss deleted file mode 100644 index a13e02528..000000000 --- a/packages/console/src/components/AppContent/components/Content/index.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.content { - flex-grow: 1; -} diff --git a/packages/console/src/components/AppContent/components/Content/index.tsx b/packages/console/src/components/AppContent/components/Content/index.tsx deleted file mode 100644 index e1f1742bd..000000000 --- a/packages/console/src/components/AppContent/components/Content/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React, { ReactNode } from 'react'; - -import * as styles from './index.module.scss'; - -type Props = { - children: ReactNode; -}; - -const Content = ({ children }: Props) => { - return
{children}
; -}; - -export default Content; diff --git a/packages/console/src/components/AppContent/index.module.scss b/packages/console/src/components/AppContent/index.module.scss index 4f9606c8b..a4b179cc6 100644 --- a/packages/console/src/components/AppContent/index.module.scss +++ b/packages/console/src/components/AppContent/index.module.scss @@ -14,6 +14,10 @@ padding-right: _.unit(5); margin-bottom: _.unit(6); overflow: hidden; + + .main { + flex-grow: 1; + } } .light { diff --git a/packages/console/src/components/AppContent/index.tsx b/packages/console/src/components/AppContent/index.tsx index fdd843f2d..6e48f0e93 100644 --- a/packages/console/src/components/AppContent/index.tsx +++ b/packages/console/src/components/AppContent/index.tsx @@ -2,7 +2,6 @@ import { useLogto } from '@logto/react'; import React, { useEffect } from 'react'; import { Outlet, useHref } from 'react-router-dom'; -import Content from './components/Content'; import Sidebar from './components/Sidebar'; import Topbar from './components/Topbar'; import * as styles from './index.module.scss'; @@ -41,9 +40,9 @@ const AppContent = ({ theme }: Props) => {
- +
- +
); diff --git a/packages/console/src/components/Callback/index.tsx b/packages/console/src/pages/Callback/index.tsx similarity index 100% rename from packages/console/src/components/Callback/index.tsx rename to packages/console/src/pages/Callback/index.tsx