Logo
Explore Help
Register Sign In
nt_web_template/full-stack-fastapi-template
2
0
Fork 0
You've already forked full-stack-fastapi-template
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
7c2b617c0922088e6ec76f82bd57ff0094bce78e
full-stack-fastapi-template/new-frontend/src/hooks/useCustomToast.tsx

20 lines
447 B
TypeScript
Raw Normal View History

✨ Restructure folders, allow editing of users/items, and implement other refactors and improvements (#603) * Reorganize project directory structure * Allow edit users/items, add useAuth and useCustomToast, password confirmation * Minor improvements for consistency * Add 'Cancel' button to UserInformation in editMode * Refactor UserSettings * Enable user password changes and improve error handling * Enable user information update * Add logout to Sidebar in mobile devices, conditional tabs depending on role and other improvements * Add badges * Remove comment * Appearance tab updates * Change badge color * Reset inputs when clicking on 'Cancel' button * Disable actions menu for Superuser when logged in * Modify Logout and update stores
2024-02-26 09:39:09 -05:00
import { useCallback } from 'react';
import { useToast } from '@chakra-ui/react';
const useCustomToast = () => {
const toast = useToast();
const showToast = useCallback((title: string, description: string, status: 'success' | 'error') => {
toast({
title,
description,
status,
isClosable: true,
});
}, [toast]);
return showToast;
};
export default useCustomToast;
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.3 Page: 39ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API