From 1cf7a706c84bc6618a2d5c3c16ab9ad6c17773ef Mon Sep 17 00:00:00 2001 From: x1unix Date: Sun, 21 Jan 2024 00:07:59 -0500 Subject: [PATCH] fix: refactor components structure --- .../Panel => elements/panel/PanelAction}/PanelAction.css | 0 .../Panel => elements/panel/PanelAction}/PanelAction.tsx | 0 web/src/components/elements/panel/PanelAction/index.ts | 1 + .../Panel => elements/panel/PanelHeader}/PanelHeader.css | 0 .../Panel => elements/panel/PanelHeader}/PanelHeader.tsx | 2 +- web/src/components/elements/panel/PanelHeader/index.ts | 1 + .../elements/tabs/TabHeader/TabHeader.module.css | 0 web/src/components/elements/tabs/TabHeader/TabHeader.tsx | 9 --------- .../elements/tabs/TabLabel/TabLabel.module.css | 0 web/src/components/elements/tabs/TabLabel/TabLabel.tsx | 1 - .../features/inspector/InspectorPanel/InspectorPanel.tsx | 6 +++--- .../features/inspector/RunOutput/RunOutput.tsx | 6 +++--- web/src/components/layout/StatusBar/StatusBar.tsx | 6 +++--- .../components/pages/PlaygroundPage/PlaygroundPage.tsx | 4 ++-- 14 files changed, 14 insertions(+), 22 deletions(-) rename web/src/components/{layout/Panel => elements/panel/PanelAction}/PanelAction.css (100%) rename web/src/components/{layout/Panel => elements/panel/PanelAction}/PanelAction.tsx (100%) create mode 100644 web/src/components/elements/panel/PanelAction/index.ts rename web/src/components/{layout/Panel => elements/panel/PanelHeader}/PanelHeader.css (100%) rename web/src/components/{layout/Panel => elements/panel/PanelHeader}/PanelHeader.tsx (93%) create mode 100644 web/src/components/elements/panel/PanelHeader/index.ts delete mode 100644 web/src/components/elements/tabs/TabHeader/TabHeader.module.css delete mode 100644 web/src/components/elements/tabs/TabHeader/TabHeader.tsx delete mode 100644 web/src/components/elements/tabs/TabLabel/TabLabel.module.css delete mode 100644 web/src/components/elements/tabs/TabLabel/TabLabel.tsx diff --git a/web/src/components/layout/Panel/PanelAction.css b/web/src/components/elements/panel/PanelAction/PanelAction.css similarity index 100% rename from web/src/components/layout/Panel/PanelAction.css rename to web/src/components/elements/panel/PanelAction/PanelAction.css diff --git a/web/src/components/layout/Panel/PanelAction.tsx b/web/src/components/elements/panel/PanelAction/PanelAction.tsx similarity index 100% rename from web/src/components/layout/Panel/PanelAction.tsx rename to web/src/components/elements/panel/PanelAction/PanelAction.tsx diff --git a/web/src/components/elements/panel/PanelAction/index.ts b/web/src/components/elements/panel/PanelAction/index.ts new file mode 100644 index 00000000..9922d79b --- /dev/null +++ b/web/src/components/elements/panel/PanelAction/index.ts @@ -0,0 +1 @@ +export * from './PanelAction'; diff --git a/web/src/components/layout/Panel/PanelHeader.css b/web/src/components/elements/panel/PanelHeader/PanelHeader.css similarity index 100% rename from web/src/components/layout/Panel/PanelHeader.css rename to web/src/components/elements/panel/PanelHeader/PanelHeader.css diff --git a/web/src/components/layout/Panel/PanelHeader.tsx b/web/src/components/elements/panel/PanelHeader/PanelHeader.tsx similarity index 93% rename from web/src/components/layout/Panel/PanelHeader.tsx rename to web/src/components/elements/panel/PanelHeader/PanelHeader.tsx index 79557b7b..3b619803 100644 --- a/web/src/components/layout/Panel/PanelHeader.tsx +++ b/web/src/components/elements/panel/PanelHeader/PanelHeader.tsx @@ -1,6 +1,6 @@ import React, {useContext} from 'react'; import {ITheme, ThemeContext} from '@fluentui/react'; -import {PanelAction, PanelActionProps} from '~/components/layout/Panel/PanelAction'; +import { PanelAction, type PanelActionProps } from '../PanelAction'; import './PanelHeader.css'; interface Props { diff --git a/web/src/components/elements/panel/PanelHeader/index.ts b/web/src/components/elements/panel/PanelHeader/index.ts new file mode 100644 index 00000000..c4946e74 --- /dev/null +++ b/web/src/components/elements/panel/PanelHeader/index.ts @@ -0,0 +1 @@ +export * from './PanelHeader'; diff --git a/web/src/components/elements/tabs/TabHeader/TabHeader.module.css b/web/src/components/elements/tabs/TabHeader/TabHeader.module.css deleted file mode 100644 index e69de29b..00000000 diff --git a/web/src/components/elements/tabs/TabHeader/TabHeader.tsx b/web/src/components/elements/tabs/TabHeader/TabHeader.tsx deleted file mode 100644 index a4b92dfd..00000000 --- a/web/src/components/elements/tabs/TabHeader/TabHeader.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -interface Props {} - -export const TabHeader: React.FC = () => { - return ( - <> - ) -} diff --git a/web/src/components/elements/tabs/TabLabel/TabLabel.module.css b/web/src/components/elements/tabs/TabLabel/TabLabel.module.css deleted file mode 100644 index e69de29b..00000000 diff --git a/web/src/components/elements/tabs/TabLabel/TabLabel.tsx b/web/src/components/elements/tabs/TabLabel/TabLabel.tsx deleted file mode 100644 index 336ce12b..00000000 --- a/web/src/components/elements/tabs/TabLabel/TabLabel.tsx +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/web/src/components/features/inspector/InspectorPanel/InspectorPanel.tsx b/web/src/components/features/inspector/InspectorPanel/InspectorPanel.tsx index 289f0567..5a2171a9 100644 --- a/web/src/components/features/inspector/InspectorPanel/InspectorPanel.tsx +++ b/web/src/components/features/inspector/InspectorPanel/InspectorPanel.tsx @@ -9,8 +9,8 @@ import { VscSplitVertical } from 'react-icons/vsc'; -import { RunOutput } from '../RunOutput'; -import { PanelHeader } from '~/components/layout/Panel/PanelHeader'; +import { ConnectedRunOutput } from '../RunOutput'; +import { PanelHeader } from '~/components/elements/panel/PanelHeader'; import {LayoutType, DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH} from '~/styles/layout'; import './InspectorPanel.css'; @@ -116,7 +116,7 @@ export const InspectorPanel: React.FC = ({ }} /> ); diff --git a/web/src/components/features/inspector/RunOutput/RunOutput.tsx b/web/src/components/features/inspector/RunOutput/RunOutput.tsx index 4297c848..4bd58b4e 100644 --- a/web/src/components/features/inspector/RunOutput/RunOutput.tsx +++ b/web/src/components/features/inspector/RunOutput/RunOutput.tsx @@ -21,7 +21,7 @@ interface StateProps { terminal: TerminalState } -const RunOutputBase: React.FC = ({ status, monaco, terminal }) => { +const RunOutput: React.FC = ({ status, monaco, terminal }) => { const theme = useTheme(); const { fontSize, renderingBackend } = terminal.settings; const styles = useMemo(() => { @@ -74,9 +74,9 @@ const RunOutputBase: React.FC = ({ status, monaco, termin ) } -export const RunOutput = connect(( +export const ConnectedRunOutput = connect(( { status, monaco, terminal } ) => ({ status, monaco, terminal -}))(RunOutputBase); +}))(RunOutput); diff --git a/web/src/components/layout/StatusBar/StatusBar.tsx b/web/src/components/layout/StatusBar/StatusBar.tsx index aaa4662b..bb17b2fe 100644 --- a/web/src/components/layout/StatusBar/StatusBar.tsx +++ b/web/src/components/layout/StatusBar/StatusBar.tsx @@ -92,7 +92,7 @@ const getStatusItem = ({loading, running, lastError}: StateProps) => { } -const StatusBarBase: React.FC = ({ +const StatusBar: React.FC = ({ loading, running, lastError, @@ -152,7 +152,7 @@ const StatusBarBase: React.FC = ({ ); }; -export const StatusBar = connect( +export const ConnectedStatusBar = connect( ({status}) => { const { loading, @@ -162,4 +162,4 @@ export const StatusBar = connect( } = status!; return { loading, lastError, running, markers }; } -)(StatusBarBase); +)(StatusBar); diff --git a/web/src/components/pages/PlaygroundPage/PlaygroundPage.tsx b/web/src/components/pages/PlaygroundPage/PlaygroundPage.tsx index dda6efd5..a7826c4b 100644 --- a/web/src/components/pages/PlaygroundPage/PlaygroundPage.tsx +++ b/web/src/components/pages/PlaygroundPage/PlaygroundPage.tsx @@ -12,7 +12,7 @@ import { FlexContainer } from '~/components/features/editor/FlexContainer'; import { InspectorPanel } from '~/components/features/inspector/InspectorPanel/InspectorPanel'; import { NotificationHost } from "~/components/modals/Notification"; import { Layout } from '~/components/layout/Layout/Layout'; -import { StatusBar } from '~/components/layout/StatusBar'; +import { ConnectedStatusBar } from '~/components/layout/StatusBar'; import './PlaygroundPage.css'; @@ -47,7 +47,7 @@ export const PlaygroundPage = connect(({ panel }: any) => ({ panelProps: panel } /> - + ); });