From b64c2a5fba9110193e4b4bf25c8acc4c8c8167ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Sun, 4 Jun 2023 23:56:15 +0100 Subject: [PATCH] refactor: use tab instead of modal. fixed layout as well. --- src/__tests__/sanity-check.test.tsx | 4 +- src/components/App.tsx | 23 ---------- src/components/AppRoot.tsx | 32 ++++++++++++-- src/components/Footer.tsx | 66 ++++++++++++++--------------- src/components/Toolbar.tsx | 23 ---------- src/modals/SettingsModal.tsx | 42 ------------------ src/tabs/MainTab.tsx | 18 ++++++++ src/tabs/SettingsTab.tsx | 10 +++++ src/theme.ts | 9 ++-- 9 files changed, 98 insertions(+), 129 deletions(-) delete mode 100644 src/components/App.tsx delete mode 100644 src/components/Toolbar.tsx delete mode 100644 src/modals/SettingsModal.tsx create mode 100644 src/tabs/MainTab.tsx create mode 100644 src/tabs/SettingsTab.tsx diff --git a/src/__tests__/sanity-check.test.tsx b/src/__tests__/sanity-check.test.tsx index e6f25a0..bebac59 100644 --- a/src/__tests__/sanity-check.test.tsx +++ b/src/__tests__/sanity-check.test.tsx @@ -1,5 +1,5 @@ import { renderWithProviders, screen, waitFor } from '~/test-utils/test-helper'; -import App from '~/components/App'; +import { AppRoot } from '~/components/AppRoot'; vi.mock('../decrypt-worker/client', () => { return { @@ -10,7 +10,7 @@ vi.mock('../decrypt-worker/client', () => { }); test('should be able to render App', async () => { - renderWithProviders(); + renderWithProviders(); // Should eventually load sdk version await waitFor(() => screen.getByTestId('sdk-version')); diff --git a/src/components/App.tsx b/src/components/App.tsx deleted file mode 100644 index 6505f44..0000000 --- a/src/components/App.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Box, Center, Container } from '@chakra-ui/react'; -import { SelectFile } from './SelectFile'; - -import { FileListing } from '~/features/file-listing/FileListing'; -import { Footer } from './Footer'; -import { Toolbar } from './Toolbar'; - -function App() { - return ( - - -
- -
- - -