chore: adjust toast top distance (#2953)

* adjust toast top distance

* save button top
This commit is contained in:
heheer
2024-10-18 17:20:57 +08:00
committed by GitHub
parent 40f527a021
commit 6522cc7dfa
3 changed files with 19 additions and 6 deletions

View File

@@ -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(