Skip to content

Commit

Permalink
fix: refactor components structure
Browse files Browse the repository at this point in the history
  • Loading branch information
x1unix committed Jan 21, 2024
1 parent 90f4364 commit 1cf7a70
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 22 deletions.
1 change: 1 addition & 0 deletions web/src/components/elements/panel/PanelAction/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './PanelAction';
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
1 change: 1 addition & 0 deletions web/src/components/elements/panel/PanelHeader/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './PanelHeader';
Empty file.
9 changes: 0 additions & 9 deletions web/src/components/elements/tabs/TabHeader/TabHeader.tsx

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion web/src/components/elements/tabs/TabLabel/TabLabel.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -116,7 +116,7 @@ export const InspectorPanel: React.FC<Props> = ({
}}
/>
<div className="InspectorPanel__container" hidden={isCollapsed}>
<RunOutput />
<ConnectedRunOutput />
</div>
</Resizable>
);
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/features/inspector/RunOutput/RunOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface StateProps {
terminal: TerminalState
}

const RunOutputBase: React.FC<StateProps & OwnProps> = ({ status, monaco, terminal }) => {
const RunOutput: React.FC<StateProps & OwnProps> = ({ status, monaco, terminal }) => {
const theme = useTheme();
const { fontSize, renderingBackend } = terminal.settings;
const styles = useMemo(() => {
Expand Down Expand Up @@ -74,9 +74,9 @@ const RunOutputBase: React.FC<StateProps & OwnProps> = ({ status, monaco, termin
)
}

export const RunOutput = connect<StateProps, OwnProps>((
export const ConnectedRunOutput = connect<StateProps, OwnProps>((
{ status, monaco, terminal }
) => ({
status, monaco, terminal
}))(RunOutputBase);
}))(RunOutput);

6 changes: 3 additions & 3 deletions web/src/components/layout/StatusBar/StatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const getStatusItem = ({loading, running, lastError}: StateProps) => {
}


const StatusBarBase: React.FC<Props> = ({
const StatusBar: React.FC<Props> = ({
loading,
running,
lastError,
Expand Down Expand Up @@ -152,7 +152,7 @@ const StatusBarBase: React.FC<Props> = ({
);
};

export const StatusBar = connect<StateProps, OwnProps>(
export const ConnectedStatusBar = connect<StateProps, OwnProps>(
({status}) => {
const {
loading,
Expand All @@ -162,4 +162,4 @@ export const StatusBar = connect<StateProps, OwnProps>(
} = status!;
return { loading, lastError, running, markers };
}
)(StatusBarBase);
)(StatusBar);
4 changes: 2 additions & 2 deletions web/src/components/pages/PlaygroundPage/PlaygroundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -47,7 +47,7 @@ export const PlaygroundPage = connect(({ panel }: any) => ({ panelProps: panel }
/>
<NotificationHost />
</Layout>
<StatusBar />
<ConnectedStatusBar />
</div>
);
});

0 comments on commit 1cf7a70

Please sign in to comment.