TF-94 Number FontFamily Added To Project/Jalali Moment Added To Project/ Permission Format Appended To Sidebar Menu

This commit is contained in:
2023-08-30 15:34:44 +03:30
parent 67e389062f
commit 59e652c182
5 changed files with 43 additions and 27 deletions

View File

@@ -2,6 +2,9 @@
const nextConfig = {
reactStrictMode: true,
images: {
domains: ['loan.witel.ir', /* other domains */],
},
i18n: {
defaultLocale: 'fa',
locales: ['fa'],

View File

@@ -63,8 +63,9 @@ const EditFormComponent = () => {
}
setInitialValues(formattedData);
setLoadingPage(false)
}).catch(() => {
})
})
.catch(() => {
})
}, [provinceList]);
// validation and request action of form

View File

@@ -16,7 +16,6 @@ const UploadSystem = ({
}) => {
const t = useTranslations();
const fileInputRef = useRef(null);
const [selectedImage, setSelectedImage] = useState(default_image || "/images/upload-image.svg");
const [fileType, setFileType] = useState(null);
const [fileName, setFileName] = useState("");
@@ -39,16 +38,12 @@ const UploadSystem = ({
border: "1px dashed #d32f2f",
borderRadius: "5px",
padding: "5px",
width: '200px',
height: '200px'
} : {
cursor: "pointer",
objectFit: "contain",
border: "1px dashed #e1e1e1",
borderRadius: "5px",
padding: "5px",
width: '200px',
height: '200px'
}
const handleClick = () => {
@@ -72,13 +67,16 @@ const UploadSystem = ({
>
{label}
</Typography>
{selectedImage === "/images/upload-image.svg" ? (
<Box sx={{position: "relative"}}>
</Box>
{selectedImage === "/images/upload-image.svg" || selectedImage === default_image ? (
<Image
src={selectedImage}
priority
alt={imageAlt}
width={0}
height={0}
width={200}
height={200}
onClick={handleClick}
style={uploadBoxStyle}
/>
@@ -87,8 +85,8 @@ const UploadSystem = ({
src={selectedImage}
priority
alt={imageAlt}
width={0}
height={0}
width={200}
height={200}
onClick={handleClick}
style={uploadBoxStyle}
/>

View File

@@ -11,6 +11,7 @@ const sidebarMenu = [
icon: <SpaceDashboardIcon/>,
userType: 0,
selected: false,
permission_name: "all"
},
{
key: "sidebar.add-request-loan",
@@ -19,6 +20,7 @@ const sidebarMenu = [
icon: <DataSaverOnIcon/>,
userType: 1,
selected: false,
permission_name: "can_request_a_new_loan"
},
{
key: "sidebar.followUp-loan",
@@ -27,6 +29,7 @@ const sidebarMenu = [
icon: <BookmarkAddedIcon/>,
userType: 1,
selected: false,
permission_name: "all"
},
{
key: "sidebar.add-request-loan",
@@ -35,6 +38,7 @@ const sidebarMenu = [
icon: <DataSaverOnIcon/>,
userType: 2,
selected: false,
permission_name: "can_request_a_new_loan"
},
{
key: "sidebar.followUp-loan",
@@ -43,6 +47,7 @@ const sidebarMenu = [
icon: <BookmarkAddedIcon/>,
userType: 2,
selected: false,
permission_name: "all"
},
],
];

View File

@@ -41,20 +41,29 @@ export default function SidebarList({handleDrawerToggle}) {
return (
<List>
{itemMenu.map((itemArr, index) => (
<Fragment key={index}>
{itemArr.map((item) =>
(item.userType === user.type_id || item.userType === 0) ? (
<SidebarListItem
item={item}
dispatch={dispatch}
key={item.key}
handleDrawerToggle={handleDrawerToggle}
/>
) : null
)}
<Divider/>
</Fragment>
))}
<Fragment key={index}>
{itemArr.map((item) => {
if (
(item.userType === user.type_id || item.userType === 0) &&
(user[item.permission_name] || item.permission_name === "all")
) {
return (
<SidebarListItem
item={item}
dispatch={dispatch}
key={item.key}
handleDrawerToggle={handleDrawerToggle}
/>
);
} else {
return null;
}
})}
<Divider/>
</Fragment>
)
)}
</List>
);
)
;
}