jgest-react-vite 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -0
- package/index.js +21 -0
- package/package.json +17 -0
- package/template/.env +1 -0
- package/template/README.md +116 -0
- package/template/eslint.config.js +26 -0
- package/template/index.html +13 -0
- package/template/package.json +40 -0
- package/template/pnpm-lock.yaml +3339 -0
- package/template/public/vite.svg +1 -0
- package/template/src/App.tsx +30 -0
- package/template/src/Router.tsx +17 -0
- package/template/src/components/main/ThemeSwitch.tsx +80 -0
- package/template/src/components/shared/MyModal.tsx +51 -0
- package/template/src/components/shared/MyPopover.tsx +44 -0
- package/template/src/hooks/shared/useNotification.ts +25 -0
- package/template/src/hooks/shared/useSetTimezone.ts +20 -0
- package/template/src/index.css +9 -0
- package/template/src/layouts/MainLayout.tsx +23 -0
- package/template/src/main.tsx +10 -0
- package/template/src/modules/MainPage/MainPageContent.tsx +100 -0
- package/template/src/pages/MainPage/MainPage.tsx +12 -0
- package/template/src/providers/NotificationProvider/NotificationProvider.tsx +61 -0
- package/template/src/providers/NotificationProvider/context/NotificationContext.tsx +20 -0
- package/template/src/services/ApiService.ts +54 -0
- package/template/src/services/ToBeTested/ApiService-New.ts +94 -0
- package/template/src/store/ThemeStore/Themes/themes.ts +28 -0
- package/template/src/store/ThemeStore/themeStore.ts +28 -0
- package/template/tsconfig.app.json +28 -0
- package/template/tsconfig.json +7 -0
- package/template/tsconfig.node.json +26 -0
- package/template/vite.config.ts +18 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material/styles';
|
|
2
|
+
import type { Theme } from '@mui/material/styles';
|
|
3
|
+
|
|
4
|
+
export const darkTheme: Theme = createTheme({
|
|
5
|
+
palette: {
|
|
6
|
+
mode: 'dark',
|
|
7
|
+
background: {
|
|
8
|
+
default: '#303030',
|
|
9
|
+
paper: '#424242',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const lightTheme: Theme = createTheme({
|
|
14
|
+
palette: {
|
|
15
|
+
mode: 'light',
|
|
16
|
+
background: {
|
|
17
|
+
default: '#f5f5f5',
|
|
18
|
+
paper: '#ffffff',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const themes = {
|
|
24
|
+
light: lightTheme,
|
|
25
|
+
dark: darkTheme,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ThemeMode = keyof typeof themes;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { persist } from 'zustand/middleware';
|
|
3
|
+
import type { ThemeMode } from './Themes/themes';
|
|
4
|
+
|
|
5
|
+
// Interfaz para el estado del tema
|
|
6
|
+
interface ThemeState {
|
|
7
|
+
mode: ThemeMode;
|
|
8
|
+
toggleTheme: () => void;
|
|
9
|
+
setMode: (mode: ThemeMode) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Store de Zustand para gestionar el tema de la aplicación
|
|
13
|
+
export const themeStore = create<ThemeState>()(
|
|
14
|
+
persist(
|
|
15
|
+
(set) => ({
|
|
16
|
+
mode: 'light', // Modo por defecto
|
|
17
|
+
toggleTheme: () => {
|
|
18
|
+
set((state) => ({
|
|
19
|
+
mode: state.mode === 'light' ? 'dark' : 'light',
|
|
20
|
+
}));
|
|
21
|
+
},
|
|
22
|
+
setMode: (mode) => set({ mode }),
|
|
23
|
+
}),
|
|
24
|
+
{
|
|
25
|
+
name: 'theme-storage', // Nombre del almacenamiento en localStorage
|
|
26
|
+
},
|
|
27
|
+
),
|
|
28
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"erasableSyntaxOnly": true,
|
|
24
|
+
"noFallthroughCasesInSwitch": true,
|
|
25
|
+
"noUncheckedSideEffectImports": true
|
|
26
|
+
},
|
|
27
|
+
"include": ["src"]
|
|
28
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"erasableSyntaxOnly": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["vite.config.ts"]
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react-swc'
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
4
|
+
|
|
5
|
+
// https://vite.dev/config/
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react(), tailwindcss()],
|
|
8
|
+
server: {
|
|
9
|
+
proxy: {
|
|
10
|
+
'/newApi': {
|
|
11
|
+
target: 'https://192.168.150.92:8003',
|
|
12
|
+
changeOrigin: true, // Cambiar el origen del host de la solicitud
|
|
13
|
+
secure: false, // Ignorar el error de certificado (autofirmado)
|
|
14
|
+
rewrite: (path) => path.replace(/^\/newApi/, '/api')
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|