mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
chore: adjust toast top distance (#2953)
Some checks failed
Deploy doc image by kubeconfig / build-fastgpt-docs-images (push) Has been cancelled
Deploy doc image to vercel / deploy-production (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Has been cancelled
Deploy doc image by kubeconfig / update-docs-image (push) Has been cancelled
Some checks failed
Deploy doc image by kubeconfig / build-fastgpt-docs-images (push) Has been cancelled
Deploy doc image to vercel / deploy-production (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Has been cancelled
Deploy doc image by kubeconfig / update-docs-image (push) Has been cancelled
* adjust toast top distance * save button top
This commit is contained in:
parent
40f527a021
commit
6522cc7dfa
|
|
@ -1,14 +1,17 @@
|
|||
import { useToast as uToast, UseToastOptions } from '@chakra-ui/react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { CSSProperties, useCallback } from 'react';
|
||||
|
||||
export const useToast = (props?: UseToastOptions & { containerStyle?: CSSProperties }) => {
|
||||
const { containerStyle, ...toastProps } = props || {};
|
||||
|
||||
export const useToast = (props?: UseToastOptions) => {
|
||||
const toast = uToast({
|
||||
position: 'top',
|
||||
duration: 2000,
|
||||
containerStyle: {
|
||||
fontSize: 'sm'
|
||||
fontSize: 'sm',
|
||||
...containerStyle
|
||||
},
|
||||
...props
|
||||
...toastProps
|
||||
});
|
||||
|
||||
const myToast = useCallback(
|
||||
|
|
|
|||
|
|
@ -25,7 +25,12 @@ const SaveButton = ({
|
|||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [isSave, setIsSave] = useState(false);
|
||||
const { toast } = useToast();
|
||||
const { toast } = useToast({
|
||||
containerStyle: {
|
||||
mt: 20,
|
||||
fontSize: 'sm'
|
||||
}
|
||||
});
|
||||
|
||||
const {
|
||||
isOpen: isSaveAndPublishModalOpen,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ const SaveAndPublishModal = ({
|
|||
onClickSave: (data: { isPublish: boolean; versionName: string }) => Promise<void>;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { toast } = useToast();
|
||||
const { toast } = useToast({
|
||||
containerStyle: {
|
||||
mt: 20,
|
||||
fontSize: 'sm'
|
||||
}
|
||||
});
|
||||
const { register, handleSubmit } = useForm<FormType>({
|
||||
defaultValues: {
|
||||
versionName: formatTime2YMDHMS(new Date()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue