📦 react toast

This commit is contained in:
sam 2025-02-26 17:36:30 +08:00
parent 91e8581e07
commit c8726eba73
3 changed files with 50 additions and 6 deletions

View File

@ -5,6 +5,8 @@ import { IRootState } from '@/store';
import { toggleRTL, toggleTheme, toggleMenu, toggleLayout, toggleAnimation, toggleNavbar, toggleSemidark } from '@/store/themeConfigSlice'; import { toggleRTL, toggleTheme, toggleMenu, toggleLayout, toggleAnimation, toggleNavbar, toggleSemidark } from '@/store/themeConfigSlice';
import Loading from '@/components/layouts/loading'; import Loading from '@/components/layouts/loading';
import { getTranslation } from '@/i18n'; import { getTranslation } from '@/i18n';
import { Toaster } from 'react-hot-toast';
function App({ children }: PropsWithChildren) { function App({ children }: PropsWithChildren) {
const themeConfig = useSelector((state: IRootState) => state.themeConfig); const themeConfig = useSelector((state: IRootState) => state.themeConfig);
@ -33,6 +35,7 @@ function App({ children }: PropsWithChildren) {
} main-section relative font-nunito text-sm font-normal antialiased`} } main-section relative font-nunito text-sm font-normal antialiased`}
> >
{isLoading ? <Loading /> : children} {isLoading ? <Loading /> : children}
<Toaster />
</div> </div>
); );
} }

52
package-lock.json generated
View File

@ -30,6 +30,7 @@
"react-animate-height": "^3.1.0", "react-animate-height": "^3.1.0",
"react-apexcharts": "^1.7.0", "react-apexcharts": "^1.7.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-hot-toast": "^2.5.2",
"react-i18next": "^12.1.5", "react-i18next": "^12.1.5",
"react-perfect-scrollbar": "^1.5.8", "react-perfect-scrollbar": "^1.5.8",
"react-popper": "^2.3.0", "react-popper": "^2.3.0",
@ -1612,9 +1613,9 @@
} }
}, },
"node_modules/csstype": { "node_modules/csstype": {
"version": "3.1.1", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
}, },
"node_modules/damerau-levenshtein": { "node_modules/damerau-levenshtein": {
"version": "1.0.8", "version": "1.0.8",
@ -2806,6 +2807,14 @@
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
}, },
"node_modules/goober": {
"version": "2.1.16",
"resolved": "https://registry.npmjs.org/goober/-/goober-2.1.16.tgz",
"integrity": "sha512-erjk19y1U33+XAMe1VTvIONHYoSqE4iS7BYUZfHaqeohLmnC0FdxEh7rQU+6MZ4OajItzjZFSRtVANrQwNq6/g==",
"peerDependencies": {
"csstype": "^3.0.10"
}
},
"node_modules/gopd": { "node_modules/gopd": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@ -4527,6 +4536,22 @@
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz",
"integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA=="
}, },
"node_modules/react-hot-toast": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.5.2.tgz",
"integrity": "sha512-Tun3BbCxzmXXM7C+NI4qiv6lT0uwGh4oAfeJyNOjYUejTsm35mK9iCaYLGv8cBz9L5YxZLx/2ii7zsIwPtPUdw==",
"dependencies": {
"csstype": "^3.1.3",
"goober": "^2.1.16"
},
"engines": {
"node": ">=10"
},
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
}
},
"node_modules/react-i18next": { "node_modules/react-i18next": {
"version": "12.1.5", "version": "12.1.5",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-12.1.5.tgz", "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-12.1.5.tgz",
@ -6736,9 +6761,9 @@
"dev": true "dev": true
}, },
"csstype": { "csstype": {
"version": "3.1.1", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
}, },
"damerau-levenshtein": { "damerau-levenshtein": {
"version": "1.0.8", "version": "1.0.8",
@ -7616,6 +7641,12 @@
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
}, },
"goober": {
"version": "2.1.16",
"resolved": "https://registry.npmjs.org/goober/-/goober-2.1.16.tgz",
"integrity": "sha512-erjk19y1U33+XAMe1VTvIONHYoSqE4iS7BYUZfHaqeohLmnC0FdxEh7rQU+6MZ4OajItzjZFSRtVANrQwNq6/g==",
"requires": {}
},
"gopd": { "gopd": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@ -8776,6 +8807,15 @@
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz",
"integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA=="
}, },
"react-hot-toast": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.5.2.tgz",
"integrity": "sha512-Tun3BbCxzmXXM7C+NI4qiv6lT0uwGh4oAfeJyNOjYUejTsm35mK9iCaYLGv8cBz9L5YxZLx/2ii7zsIwPtPUdw==",
"requires": {
"csstype": "^3.1.3",
"goober": "^2.1.16"
}
},
"react-i18next": { "react-i18next": {
"version": "12.1.5", "version": "12.1.5",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-12.1.5.tgz", "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-12.1.5.tgz",

View File

@ -31,6 +31,7 @@
"react-animate-height": "^3.1.0", "react-animate-height": "^3.1.0",
"react-apexcharts": "^1.7.0", "react-apexcharts": "^1.7.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-hot-toast": "^2.5.2",
"react-i18next": "^12.1.5", "react-i18next": "^12.1.5",
"react-perfect-scrollbar": "^1.5.8", "react-perfect-scrollbar": "^1.5.8",
"react-popper": "^2.3.0", "react-popper": "^2.3.0",