diff --git a/services/client/src/core/form/AppForm.tsx b/services/client/src/core/form/AppForm.tsx index 71ee74b..8b478c5 100644 --- a/services/client/src/core/form/AppForm.tsx +++ b/services/client/src/core/form/AppForm.tsx @@ -64,7 +64,7 @@ export const AppForm: FC = React.memo(props => { value={values[field.name]} setValue={value => form.setValue(field.name as any, value)} /> - {field.helperText} + {field.helperText && {field.helperText}} ); })} diff --git a/services/client/src/core/form/custom-fields/field-map.tsx b/services/client/src/core/form/custom-fields/field-map.tsx index 46de9e1..fc04cd6 100644 --- a/services/client/src/core/form/custom-fields/field-map.tsx +++ b/services/client/src/core/form/custom-fields/field-map.tsx @@ -2,7 +2,7 @@ import { Checkbox, TextField } from '@mui/material'; import { CountryField } from './CountryField'; export const FieldMap = { - text: ({ name, register, ...props }: any) => , + text: ({ name, register, ...props }: any) => , number: ({ name, register, ...props }: any) => , boolean: ({ name, register, ...props }: any) => , date: ({ name, register, ...props }: any) => , diff --git a/services/client/src/core/routing/ProtectedRoutes.tsx b/services/client/src/core/routing/ProtectedRoutes.tsx index db2d689..c6f98b9 100644 --- a/services/client/src/core/routing/ProtectedRoutes.tsx +++ b/services/client/src/core/routing/ProtectedRoutes.tsx @@ -5,6 +5,7 @@ import { Shell } from '../../view/layout/Shell'; import { checkAuthStatus } from '../firebase/firebase'; import { GlobalJobs } from '../global-jobs/GlobalJobs'; import { OnboardingPage } from '../../view/pages/onboarding/OnboardingPage'; +import { DevicePage } from '../../view/pages/device/DevicePage'; const authGuard = async () => { const isAuthenticated = await checkAuth(); @@ -45,5 +46,6 @@ export const ProtectedRoutes: RouteObject = { { path: 'onboarding', element: }, { path: 'elevators', element: <>elevators }, { path: 'add-device', element: <>add-device }, + { path: 'device/:id', element: }, ] }; diff --git a/services/client/src/core/translations/i18n.ts b/services/client/src/core/translations/i18n.ts index dd9d119..a13af95 100644 --- a/services/client/src/core/translations/i18n.ts +++ b/services/client/src/core/translations/i18n.ts @@ -19,7 +19,7 @@ i18n .use(initReactI18next) // passes i18n down to react-i18next .init({ resources, - lng: 'en', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources + lng: 'he', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage // if you're using a language detector, do not define the lng option diff --git a/services/client/src/view/layout/SideMenu.tsx b/services/client/src/view/layout/SideMenu.tsx index fc42e59..57f77ef 100644 --- a/services/client/src/view/layout/SideMenu.tsx +++ b/services/client/src/view/layout/SideMenu.tsx @@ -39,7 +39,7 @@ export const SideMenu: FC = React.memo(() => { - + Elevate diff --git a/services/client/src/view/pages/HomePage.tsx b/services/client/src/view/pages/HomePage.tsx index 5671564..f361be8 100644 --- a/services/client/src/view/pages/HomePage.tsx +++ b/services/client/src/view/pages/HomePage.tsx @@ -1,6 +1,63 @@ import { FC } from 'react'; +import { AppForm } from '../../core/form/AppForm'; +import { useForm } from 'react-hook-form'; +import { Button } from '@mui/material'; +import { useNavigate } from 'react-router-dom'; export const HomePage: FC = () => { + const form = useForm(); + const navigate = useNavigate(); - return
; + return
+
+
מצב כללי
+
+
+ 18 + פעילות +
+
+ 3 + תקלות +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ #03 + תקינה +
+
+ + + שפיר הנדסה + + + + אשדוד + +
+
+ +
+ +
+
+
+
+
; }; diff --git a/services/client/src/view/pages/device/DevicePage.tsx b/services/client/src/view/pages/device/DevicePage.tsx new file mode 100644 index 0000000..27d02ea --- /dev/null +++ b/services/client/src/view/pages/device/DevicePage.tsx @@ -0,0 +1,100 @@ +import { Button } from '@mui/material'; +import React from 'react'; +import { FC } from 'react'; +import { useNavigate, useParams } from 'react-router-dom'; + +export const DevicePage: FC = React.memo(() => { + const navigate = useNavigate(); + return ( + <> +
+
+ +
+
+ #03 + תקינה + + + Model 2BFX + +
+
+ + + שפיר הנדסה + + + + אשדוד + +
+
+
+
+
+ + עדכון אחרון + + + 24/02 12:00 + +
+
+
+
+ מתח ראשי +
+
+ יש מתח +
+
+ +
+
+ דלת חיצונית +
+
+ יש מתח +
+
+ +
+
+ דלת פנימית +
+
+ אין מתח +
+
+ +
+
+ מנוע +
+
+ יש מתח +
+
+ +
+
+ משקל +   + + משקל מקסימלי 350 kg + +
+
+ 327.8 kg +
+
+ + +
+ + ); +}); diff --git a/services/client/src/view/theme/AppTheme.tsx b/services/client/src/view/theme/AppTheme.tsx index c661bd6..8d98649 100644 --- a/services/client/src/view/theme/AppTheme.tsx +++ b/services/client/src/view/theme/AppTheme.tsx @@ -11,6 +11,7 @@ interface AppThemeProps extends React.PropsWithChildren { export const AppTheme: FC = props => { const dir = useHtmlDir(); + const theme = muiTheme(dir); return ( <> diff --git a/services/client/src/view/theme/RtlSupport.tsx b/services/client/src/view/theme/RtlSupport.tsx index 02bc96f..321c4a2 100644 --- a/services/client/src/view/theme/RtlSupport.tsx +++ b/services/client/src/view/theme/RtlSupport.tsx @@ -29,7 +29,7 @@ export function RtlSupport(props) { export function useHtmlDir() { - const [dir, setDir] = useState(document.dir); + const [dir, setDir] = useState(i18n.dir() as string); useEffect(() => { // Directly target the element diff --git a/services/client/src/view/theme/mui-theme.ts b/services/client/src/view/theme/mui-theme.ts index a5ceed1..db79b4e 100644 --- a/services/client/src/view/theme/mui-theme.ts +++ b/services/client/src/view/theme/mui-theme.ts @@ -1,6 +1,13 @@ import { Direction, createTheme } from "@mui/material"; +import { red, } from "@mui/material/colors"; export const muiTheme = (dir?: Direction ) => createTheme({ + palette: { + primary: { + main: getComputedStyle(document.documentElement).getPropertyValue('--primary-color'), + }, + }, + direction: dir, components: { MuiButton: {