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 (
-
-
-
-
-
-
-
-
-
-
- );
-}
-
-export default App;
diff --git a/src/components/AppRoot.tsx b/src/components/AppRoot.tsx
index 70d1115..897b89e 100644
--- a/src/components/AppRoot.tsx
+++ b/src/components/AppRoot.tsx
@@ -1,11 +1,15 @@
import { useEffect } from 'react';
-import App from './App';
+import { MdSettings, MdHome } from 'react-icons/md';
+import { ChakraProvider, Tabs, TabList, TabPanels, Tab, TabPanel, Icon, chakra } from '@chakra-ui/react';
+
+import { MainTab } from '~/tabs/MainTab';
+import { SettingsTab } from '~/tabs/SettingsTab';
-import { ChakraProvider } from '@chakra-ui/react';
import { Provider } from 'react-redux';
import { theme } from '~/theme';
import { persistSettings } from '~/features/settings/persistSettings';
import { setupStore } from '~/store';
+import { Footer } from '~/components/Footer';
// Private to this file only.
const store = setupStore();
@@ -16,7 +20,29 @@ export function AppRoot() {
return (
-
+
+
+
+
+ 应用
+
+
+
+ 设置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx
index 8cd3c68..4aa0f55 100644
--- a/src/components/Footer.tsx
+++ b/src/components/Footer.tsx
@@ -5,39 +5,39 @@ import { CurrentYear } from './CurrentYear';
export function Footer() {
return (
-
-
-
- {'音乐解锁 (__APP_VERSION_SHORT__'}
-
-
-
- {') - 移除已购音乐的加密保护。'}
-
-
- {'Copyright © 2019 - '}
- {' '}
-
- UnlockMusic 团队
-
- {' | 音乐解锁授权基于'}
-
- MIT许可协议
-
- 。
-
-
+
+
+ {'音乐解锁 (__APP_VERSION_SHORT__'}
+
+
+
+ {') - 移除已购音乐的加密保护。'}
+
+
+ {'Copyright © 2019 - '}
+ {' '}
+
+ UnlockMusic 团队
+
+ {' | 音乐解锁授权基于'}
+
+ MIT许可协议
+
+ 。
+
);
}
diff --git a/src/components/Toolbar.tsx b/src/components/Toolbar.tsx
deleted file mode 100644
index bfab2c1..0000000
--- a/src/components/Toolbar.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Button, HStack, Icon, useDisclosure } from '@chakra-ui/react';
-import { MdSettings } from 'react-icons/md';
-import { SettingsModal } from '~/modals/SettingsModal';
-
-export function Toolbar() {
- const {
- isOpen: isSettingsModalOpen,
- onClose: onSettingsModalClose,
- getButtonProps: getSettingsButtonProps,
- } = useDisclosure();
-
- return (
- <>
-
-
-
-
- >
- );
-}
diff --git a/src/modals/SettingsModal.tsx b/src/modals/SettingsModal.tsx
deleted file mode 100644
index 869d19b..0000000
--- a/src/modals/SettingsModal.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import {
- Button,
- HStack,
- Modal,
- ModalBody,
- ModalCloseButton,
- ModalContent,
- ModalFooter,
- ModalHeader,
- ModalOverlay,
-} from '@chakra-ui/react';
-
-export interface SettingsModalProps {
- onClose: () => void;
- isOpen: boolean;
-}
-
-export function SettingsModal({ isOpen, onClose }: SettingsModalProps) {
- return (
-
-
-
- 应用设置
-
-
- Hallo
- Thank you, thank you very much.
- Ha-Halo, thank you
- Thank you very much!
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/tabs/MainTab.tsx b/src/tabs/MainTab.tsx
new file mode 100644
index 0000000..8027d12
--- /dev/null
+++ b/src/tabs/MainTab.tsx
@@ -0,0 +1,18 @@
+import { Box, VStack } from '@chakra-ui/react';
+import { SelectFile } from '../components/SelectFile';
+
+import { FileListing } from '~/features/file-listing/FileListing';
+
+export function MainTab() {
+ return (
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/tabs/SettingsTab.tsx b/src/tabs/SettingsTab.tsx
new file mode 100644
index 0000000..da5f34a
--- /dev/null
+++ b/src/tabs/SettingsTab.tsx
@@ -0,0 +1,10 @@
+export function SettingsTab() {
+ return (
+
+
Hallo
+
Thank you, thank you very much.
+
Ha-Halo, thank you
+
Thank you very much!
+
+ );
+}
diff --git a/src/theme.ts b/src/theme.ts
index b7c85ea..c278b56 100644
--- a/src/theme.ts
+++ b/src/theme.ts
@@ -21,15 +21,18 @@ export const theme = extendTheme({
},
styles: {
global: {
- body: {
+ '#root': {
minHeight: '100vh',
+ maxHeight: '100vh',
+ display: 'flex',
+ flexDirection: 'column',
},
},
},
sizes: {
footer: {
- container: '7rem',
- content: '5rem',
+ container: '5rem',
+ content: '4rem',
},
},
});