Merge branch 'develop' into chore/google-authentication

This commit is contained in:
SajadMRjl
2025-08-18 02:23:27 +03:30
committed by GitHub
5 changed files with 46 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import { Box, IconButton, Typography } from '@mui/material'; import { Box, IconButton, Skeleton, Typography } from '@mui/material';
import { Icon } from '@rkheftan/harmony-ui'; import { Icon } from '@rkheftan/harmony-ui';
import { More } from 'iconsax-react'; import { More } from 'iconsax-react';
import type { UserInfo } from '@/contexts/AuthContext'; import type { UserInfo } from '@/contexts/AuthContext';
@@ -7,7 +7,7 @@ interface HeaderProps {
user: UserInfo; user: UserInfo;
} }
export const Header: React.FC<HeaderProps> = ({ user }) => { export const Header: React.FC<HeaderProps> = ({ user, loading }) => {
return ( return (
<Box <Box
sx={{ sx={{

View File

@@ -14,7 +14,6 @@ export const Layout = () => {
const theme = useTheme(); const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('md')); const isMobile = useMediaQuery(theme.breakpoints.down('md'));
const [sideNavOpen, setSideNavOpen] = useState(false); const [sideNavOpen, setSideNavOpen] = useState(false);
const { userInfo } = useAuth(); const { userInfo } = useAuth();
return ( return (
@@ -45,7 +44,9 @@ export const Layout = () => {
setSideNavOpen={setSideNavOpen} setSideNavOpen={setSideNavOpen}
user={userInfo} user={userInfo}
/> />
<Outlet /> <Box sx={{ flex: 1, overflowY: 'auto' }}>
<Outlet />
</Box>
</Box> </Box>
<SideNav <SideNav

View File

@@ -3,7 +3,7 @@ import {
Box, Box,
IconButton, IconButton,
Toolbar as MuiToolbar, Toolbar as MuiToolbar,
Typography, Skeleton,
} from '@mui/material'; } from '@mui/material';
import { Icon } from '@rkheftan/harmony-ui'; import { Icon } from '@rkheftan/harmony-ui';
import { HambergerMenu, Menu } from 'iconsax-react'; import { HambergerMenu, Menu } from 'iconsax-react';
@@ -22,6 +22,7 @@ export const Toolbar: React.FC<ToolbarProps> = ({
setSideNavOpen, setSideNavOpen,
isMobile, isMobile,
user, user,
loading,
}) => { }) => {
return ( return (
<MuiToolbar <MuiToolbar
@@ -52,8 +53,7 @@ export const Toolbar: React.FC<ToolbarProps> = ({
<Icon Component={HambergerMenu} /> <Icon Component={HambergerMenu} />
</IconButton> </IconButton>
)} )}
{/* <Logo /> */} <Logo />
<Typography variant="h6">LOGO placeholder</Typography>
</Box> </Box>
<Box <Box
sx={{ display: 'flex', height: '100%', alignItems: 'center', gap: 1 }} sx={{ display: 'flex', height: '100%', alignItems: 'center', gap: 1 }}

View File

@@ -15,7 +15,7 @@ import {
import { type InfoRowData } from '../types/settingsType'; import { type InfoRowData } from '../types/settingsType';
export async function fetchProfile() { export async function fetchProfile() {
return apiClient.post<GetProfileApiResponse>('/Profile/GetProfile'); return apiClient.post<GetProfileApiResponse>('/Profile/GetProfile', {});
} }
export async function saveProfile(payload: { export async function saveProfile(payload: {

View File

@@ -1,15 +1,4 @@
import { Layout } from '@/components'; import { Layout } from '@/components';
import {
AuthenticationPage,
ForgetPasswordPage,
UserCompletionPage,
} from '@/features/authorization';
import {
ActiveDevicesPage,
SecurityPage,
SettingPage,
UserInformationPage,
} from '@/features/profile';
import { import {
Calendar, Calendar,
Devices, Devices,
@@ -23,9 +12,45 @@ import {
Sms, Sms,
type Icon, type Icon,
} from 'iconsax-react'; } from 'iconsax-react';
import { type ReactNode } from 'react'; import { lazy, type ReactNode } from 'react';
import { Navigate } from 'react-router-dom'; import { Navigate } from 'react-router-dom';
const AuthenticationPage = lazy(() =>
import('@/features/authorization').then((module) => ({
default: module.AuthenticationPage,
})),
);
const UserCompletionPage = lazy(() =>
import('@/features/authorization').then((module) => ({
default: module.UserCompletionPage,
})),
);
const ForgetPasswordPage = lazy(() =>
import('@/features/authorization').then((module) => ({
default: module.ForgetPasswordPage,
})),
);
const UserInformationPage = lazy(() =>
import('@/features/profile').then((module) => ({
default: module.UserInformationPage,
})),
);
const SecurityPage = lazy(() =>
import('@/features/profile').then((module) => ({
default: module.SecurityPage,
})),
);
const ActiveDevicesPage = lazy(() =>
import('@/features/profile').then((module) => ({
default: module.ActiveDevicesPage,
})),
);
const SettingPage = lazy(() =>
import('@/features/profile').then((module) => ({
default: module.SettingPage,
})),
);
export interface RouteConfig { export interface RouteConfig {
path: string; path: string;
element?: ReactNode; element?: ReactNode;