From 31d55b78d4e75283a9284a44ec6de3d6b2d23c61 Mon Sep 17 00:00:00 2001 From: Nathan Seva Date: Tue, 6 Feb 2024 14:58:29 +0100 Subject: [PATCH] remove station dashboard --- .../DashboardStation.stories.tsx | 56 ---------------- .../DashboardStation.test.tsx | 19 ------ .../DashboardStation/DashboardStation.tsx | 66 ------------------- src/components/DashboardStation/index.ts | 1 - src/components/index.ts | 1 - 5 files changed, 143 deletions(-) delete mode 100644 src/components/DashboardStation/DashboardStation.stories.tsx delete mode 100644 src/components/DashboardStation/DashboardStation.test.tsx delete mode 100644 src/components/DashboardStation/DashboardStation.tsx delete mode 100644 src/components/DashboardStation/index.ts diff --git a/src/components/DashboardStation/DashboardStation.stories.tsx b/src/components/DashboardStation/DashboardStation.stories.tsx deleted file mode 100644 index b3b66d71..00000000 --- a/src/components/DashboardStation/DashboardStation.stories.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { DashboardStation } from './DashboardStation'; -import Image1Dark from '../../assets/subduedImages/dark/1.svg'; -import Image2Dark from '../../assets/subduedImages/dark/2.svg'; -import Image3Dark from '../../assets/subduedImages/dark/3.svg'; -import Image4Dark from '../../assets/subduedImages/dark/4.svg'; -import Image5Dark from '../../assets/subduedImages/dark/5.svg'; -import Image1Light from '../../assets/subduedImages/light/1.svg'; -import Image2Light from '../../assets/subduedImages/light/2.svg'; -import Image3Light from '../../assets/subduedImages/light/3.svg'; -import Image4Light from '../../assets/subduedImages/light/4.svg'; -import Image5Light from '../../assets/subduedImages/light/5.svg'; -import { PluginWallet } from '../PluginWallet'; -import WalletActive from '../../assets/plugins/wallet/walletActive.svg'; -import WalletInactive from '../../assets/plugins/wallet/walletInactive.svg'; - -export default { - title: 'Components/DashboardStation', - component: DashboardStation, -}; - -export const _DashboardStation = { - render: () => ( - <> - , - , - , - , - , - , - ]} - imagesLight={[ - , - , - , - , - , - , - ]} - components={[ - } - iconInactive={} - onClickActive={() => console.log('install')} - onClickInactive={() => console.log('launch')} - />, - , - ]} - /> - - ), -}; diff --git a/src/components/DashboardStation/DashboardStation.test.tsx b/src/components/DashboardStation/DashboardStation.test.tsx deleted file mode 100644 index 9dbe9a5f..00000000 --- a/src/components/DashboardStation/DashboardStation.test.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import '@testing-library/jest-dom'; -import { render, screen } from '@testing-library/react'; -import { DashboardStation } from './DashboardStation'; - -describe('Components | DashboardStation', () => { - test('it should render', () => { - render( - , - ); - - let dashboardStation = screen.getByTestId('dashboard-station'); - - expect(dashboardStation).toBeInTheDocument(); - }); -}); diff --git a/src/components/DashboardStation/DashboardStation.tsx b/src/components/DashboardStation/DashboardStation.tsx deleted file mode 100644 index d378a534..00000000 --- a/src/components/DashboardStation/DashboardStation.tsx +++ /dev/null @@ -1,66 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import React from 'react'; - -import { ReactNode, useEffect, useState } from 'react'; -import { Theme } from '../../util/types'; - -export interface IDashboardStationProps { - imagesDark: ReactNode[]; - imagesLight: ReactNode[]; - components: ReactNode[]; - theme?: Theme | undefined; -} - -export function DashboardStation(props: IDashboardStationProps) { - let { imagesDark, imagesLight, components, theme } = props; - - const [images, setImages] = useState([]); - const sizeClass = 'h-full w-full'; - - function loadImages() { - let imageList: ReactNode[] = [...components]; - - const diff = imagesDark.length - components.length; - for (let i = 0; i < diff; i++) { - const imageToAdd = - theme === 'theme-dark' ? imagesDark[i] : imagesLight[i]; - imageList.push(imageToAdd); - } - - setImages(imageList); - } - - useEffect(() => { - loadImages(); - }, [theme]); - - return ( -
-
-
{images[0]}
-
-
-
{images[1]}
-
-
-
{images[2]}
-
-
-
{images[3]}
-
-
-
{images[4]}
-
-
-
{images[5]}
-
-
- ); -} diff --git a/src/components/DashboardStation/index.ts b/src/components/DashboardStation/index.ts deleted file mode 100644 index fab3e5f1..00000000 --- a/src/components/DashboardStation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './DashboardStation'; diff --git a/src/components/index.ts b/src/components/index.ts index a9a5cd20..13233e1f 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -22,7 +22,6 @@ export * from './SidePanel'; export * from './Money'; export * from './InlineMoney'; export * from './Clipboard'; -export * from './DashboardStation'; export * from './PluginWallet'; export * from './TextArea'; export * from './DragDrop';