Compare commits

..

No commits in common. "e9a95d1bd63142fd693ae9fafa1126926e7ac8cd" and "9fed1ee610a6b79cfbcd22829f9be28bf2036c6e" have entirely different histories.

3 changed files with 5 additions and 29 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "um-react", "name": "um-react",
"private": true, "private": true,
"version": "0.3.2", "version": "0.3.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite", "start": "vite",

View File

@ -1,8 +1,8 @@
import { import {
chakra,
Box, Box,
Button, Button,
Center, Center,
chakra,
Flex, Flex,
HStack, HStack,
Icon, Icon,
@ -19,9 +19,9 @@ import {
TabPanels, TabPanels,
Tabs, Tabs,
Text, Text,
VStack,
useBreakpointValue, useBreakpointValue,
useToast, useToast,
VStack,
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import { PanelQMCv2Key } from './panels/PanelQMCv2Key'; import { PanelQMCv2Key } from './panels/PanelQMCv2Key';
import { useState } from 'react'; import { useState } from 'react';
@ -145,7 +145,7 @@ export function Settings() {
onClick={handleResetSettings} onClick={handleResetSettings}
colorScheme="red" colorScheme="red"
variant="ghost" variant="ghost"
title="放弃未储存的更改,将设定还原储存前的状态。" title="放弃未储存的更改,将设定还原储存前的状态。"
aria-label="放弃未储存的更改" aria-label="放弃未储存的更改"
/> />
<Button onClick={handleApplySettings}></Button> <Button onClick={handleApplySettings}></Button>

View File

@ -1,36 +1,12 @@
import { Alert, AlertIcon, Box, Button, Flex, Text, VStack } from '@chakra-ui/react'; import { Box, VStack } from '@chakra-ui/react';
import { SelectFile } from '../components/SelectFile'; import { SelectFile } from '../components/SelectFile';
import { FileListing } from '~/features/file-listing/FileListing'; import { FileListing } from '~/features/file-listing/FileListing';
import { useAppDispatch, useAppSelector } from '~/hooks.ts';
import { selectIsSettingsNotSaved } from '~/features/settings/settingsSelector.ts';
import { commitStagingChange } from '~/features/settings/settingsSlice.ts';
export function MainTab() { export function MainTab() {
const dispatch = useAppDispatch();
const isSettingsNotSaved = useAppSelector(selectIsSettingsNotSaved);
const onClickSaveSettings = () => {
dispatch(commitStagingChange());
};
return ( return (
<Box h="full" w="full" pt="4"> <Box h="full" w="full" pt="4">
<VStack gap="3"> <VStack gap="3">
{isSettingsNotSaved && (
<Alert borderRadius={7} maxW={400} status="warning">
<AlertIcon />
<Flex flexDir="row" alignItems="center" flexGrow={1} justifyContent="space-between">
<Text m={0}>
<br />
</Text>
<Button type="button" ml={3} size="md" onClick={onClickSaveSettings}>
</Button>
</Flex>
</Alert>
)}
<SelectFile /> <SelectFile />
<Box w="full"> <Box w="full">