perf: btn color (#423)

This commit is contained in:
Archer
2023-10-24 13:19:23 +08:00
committed by GitHub
parent bf6dbfb245
commit 1942cb0d67
41 changed files with 350 additions and 221 deletions

View File

@@ -11,9 +11,13 @@ import {
} from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
export const useConfirm = (props: { title?: string | null; content?: string | null }) => {
export const useConfirm = (props: {
title?: string | null;
content?: string | null;
bg?: string;
}) => {
const { t } = useTranslation();
const { title = t('Warning'), content } = props;
const { title = t('Warning'), content, bg } = props;
const [customContent, setCustomContent] = useState(content);
const { isOpen, onOpen, onClose } = useDisclosure();
@@ -61,6 +65,7 @@ export const useConfirm = (props: { title?: string | null; content?: string | nu
{t('Cancel')}
</Button>
<Button
{...(bg && { bg: `${bg} !important` })}
ml={4}
onClick={() => {
onClose();
@@ -74,7 +79,7 @@ export const useConfirm = (props: { title?: string | null; content?: string | nu
</AlertDialogOverlay>
</AlertDialog>
),
[customContent, isOpen, onClose, t, title]
[bg, customContent, isOpen, onClose, t, title]
)
};
};

View File

@@ -50,7 +50,7 @@ export const useEditTitle = ({
// eslint-disable-next-line react/display-name
const EditModal = useCallback(
() => (
({ maxLength = 30 }: { maxLength?: number }) => (
<MyModal isOpen={isOpen} onClose={onClose} title={title}>
<ModalBody>
{!!tip && (
@@ -64,7 +64,7 @@ export const useEditTitle = ({
defaultValue={defaultValue.current}
placeholder={placeholder}
autoFocus
maxLength={20}
maxLength={maxLength}
/>
</ModalBody>
<ModalFooter>

View File

@@ -378,7 +378,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
key: 'userChatInput'
},
{
moduleId: 'kbSearch',
moduleId: 'datasetSearch',
key: 'userChatInput'
}
]
@@ -501,7 +501,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
x: 956.0838440206068,
y: 887.462827870246
},
moduleId: 'kbSearch'
moduleId: 'datasetSearch'
},
...(formData.kb.searchEmptyText
? [

View File

@@ -97,7 +97,14 @@ const SelectCollections = ({
});
return (
<MyModal isOpen onClose={onClose} maxW={['90vw', '900px']} h={['90vh', '80vh']} isCentered>
<MyModal
isOpen
onClose={onClose}
maxW={['90vw', '900px']}
w={'100%'}
h={['90vh', '80vh']}
isCentered
>
<Flex flexDirection={'column'} flex={'1 0 0'}>
<Box flex={'1 0 0'} px={4} py={2}>
<Flex flexDirection={'column'} h={'100%'} position={'relative'}>