Fix issues related to search apps, notification duration, and loading icon on the explore page (#6374)

This commit is contained in:
faye1225
2024-07-17 20:24:31 +08:00
committed by GitHub
parent a6dbd26f75
commit 65bc4e0fc0
6 changed files with 59 additions and 28 deletions

View File

@@ -22,7 +22,6 @@ export type IToastProps = {
type IToastContext = {
notify: (props: IToastProps) => void
}
const defaultDuring = 3000
export const ToastContext = createContext<IToastContext>({} as IToastContext)
export const useToastContext = () => useContext(ToastContext)
@@ -89,10 +88,10 @@ export const ToastProvider = ({
const placeholder: IToastProps = {
type: 'info',
message: 'Toast message',
duration: 3000,
duration: 6000,
}
const [params, setParams] = React.useState<IToastProps>(placeholder)
const defaultDuring = params.type === 'success' ? 3000 : 6000
const [mounted, setMounted] = useState(false)
useEffect(() => {