own version of toast

This commit is contained in:
proddy
2026-06-19 11:52:33 +02:00
parent 88a777ca5f
commit 392812d489
30 changed files with 177 additions and 62 deletions
+2 -22
View File
@@ -1,8 +1,8 @@
import { memo, useEffect, useState } from 'react';
import { ToastContainer, Zoom } from 'react-toastify';
import AppRouting from 'AppRouting';
import CustomTheme from 'CustomTheme';
import { Toaster } from 'components/toast';
import TypesafeI18n from 'i18n/i18n-react';
import type { Locales } from 'i18n/i18n-types';
import { loadLocaleAsync } from 'i18n/i18n-util.async';
@@ -22,26 +22,6 @@ const AVAILABLE_LOCALES = [
'cz'
] as Locales[];
// Static toast configuration - no need to recreate on every render
const TOAST_CONTAINER_PROPS = {
position: 'bottom-left' as const,
autoClose: 3000,
hideProgressBar: false,
newestOnTop: false,
closeOnClick: true,
rtl: false,
pauseOnFocusLoss: true,
draggable: false,
pauseOnHover: false,
transition: Zoom,
closeButton: false,
theme: 'dark' as const,
toastStyle: {
border: '1px solid #177ac9',
width: 'fit-content'
}
};
const App = memo(() => {
const [wasLoaded, setWasLoaded] = useState(false);
const [locale, setLocale] = useState<Locales>('en');
@@ -64,7 +44,7 @@ const App = memo(() => {
<TypesafeI18n locale={locale}>
<CustomTheme>
<AppRouting />
<ToastContainer {...TOAST_CONTAINER_PROPS} />
<Toaster />
</CustomTheme>
</TypesafeI18n>
);