fix: use harmony-ui toast and update gitignore to ignore .npmrc

This commit is contained in:
Sajad Mirjalili
2025-08-09 14:23:40 +03:30
parent 150848370a
commit 51eaa97cd0
5 changed files with 1663 additions and 9 deletions

3
.gitignore vendored
View File

@@ -24,3 +24,6 @@ dist-ssr
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
# npm registry
.npmrc

1658
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@
"@emotion/styled": "^11.14.1", "@emotion/styled": "^11.14.1",
"@mui/material": "^7.2.0", "@mui/material": "^7.2.0",
"@mui/stylis-plugin-rtl": "^7.2.0", "@mui/stylis-plugin-rtl": "^7.2.0",
"@rkheftan/harmony-ui": "^0.1.5",
"i18next": "^25.3.0", "i18next": "^25.3.0",
"i18next-browser-languagedetector": "^8.2.0", "i18next-browser-languagedetector": "^8.2.0",
"i18next-http-backend": "^3.0.2", "i18next-http-backend": "^3.0.2",

View File

@@ -12,6 +12,7 @@ import { LanguageManager } from './components/LanguageManager';
function App() { function App() {
const { t } = useTranslation(); const { t } = useTranslation();
const showToast = useToast();
return ( return (
<> <>
@@ -41,6 +42,9 @@ function App() {
</Alert> </Alert>
</Box> </Box>
</div> </div>
<Button onClick={() => showToast({ message: 'info toast' })}>
toast
</Button>
</> </>
); );
} }
@@ -48,6 +52,7 @@ function App() {
export default App; export default App;
import { Button } from '@mui/material'; import { Button } from '@mui/material';
import { useToast } from '@rkheftan/harmony-ui';
export const ThemeToggleButton = () => { export const ThemeToggleButton = () => {
const { mode, setMode } = useColorScheme(); const { mode, setMode } = useColorScheme();

View File

@@ -3,6 +3,7 @@ import { I18nextProvider } from 'react-i18next';
import i18n from '@/config/i18n'; import i18n from '@/config/i18n';
import { CustomThemeProvider } from './CustomThemeProvider'; import { CustomThemeProvider } from './CustomThemeProvider';
import { RtlProvider } from './RtlProvider'; import { RtlProvider } from './RtlProvider';
import { ToastProvider } from '@rkheftan/harmony-ui';
export const AppProviders: React.FC<{ children: React.ReactNode }> = ({ export const AppProviders: React.FC<{ children: React.ReactNode }> = ({
children, children,
@@ -10,7 +11,9 @@ export const AppProviders: React.FC<{ children: React.ReactNode }> = ({
return ( return (
<I18nextProvider i18n={i18n}> <I18nextProvider i18n={i18n}>
<RtlProvider> <RtlProvider>
<CustomThemeProvider>{children}</CustomThemeProvider> <CustomThemeProvider>
<ToastProvider>{children}</ToastProvider>
</CustomThemeProvider>
</RtlProvider> </RtlProvider>
</I18nextProvider> </I18nextProvider>
); );