Adding Page-min-h and css to decrease the size of scrollbar.
This commit is contained in:
parent
abb383afd8
commit
4f94c040ca
File diff suppressed because it is too large
Load Diff
@ -26,15 +26,15 @@ const Header = () => {
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { data, loading } = useMaster();
|
const { data, loading } = useMaster();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const {onOpen} = useAuthModal()
|
const { onOpen } = useAuthModal()
|
||||||
const { onOpen:changePass } = useModal("ChangePassword");
|
const { onOpen: changePass } = useModal("ChangePassword");
|
||||||
const HasManageProjectPermission = useHasUserPermission(MANAGE_PROJECT);
|
const HasManageProjectPermission = useHasUserPermission(MANAGE_PROJECT);
|
||||||
const { mutate : logout,isPending:logouting} = useLogout()
|
const { mutate: logout, isPending: logouting } = useLogout()
|
||||||
|
|
||||||
const isDashboardPath =
|
const isDashboardPath =
|
||||||
/^\/dashboard$/.test(location.pathname) || /^\/$/.test(location.pathname);
|
/^\/dashboard$/.test(location.pathname) || /^\/$/.test(location.pathname);
|
||||||
const isProjectPath = /^\/projects$/.test(location.pathname);
|
const isProjectPath = /^\/projects$/.test(location.pathname);
|
||||||
const isCollectionPath =
|
const isCollectionPath =
|
||||||
/^\/collection$/.test(location.pathname) || /^\/$/.test(location.pathname);
|
/^\/collection$/.test(location.pathname) || /^\/$/.test(location.pathname);
|
||||||
|
|
||||||
const showProjectDropdown = (pathname) => {
|
const showProjectDropdown = (pathname) => {
|
||||||
@ -51,10 +51,10 @@ const Header = () => {
|
|||||||
const isAdvancePayment = /^\/advance-payment$/.test(pathname);
|
const isAdvancePayment = /^\/advance-payment$/.test(pathname);
|
||||||
const isServiceProjectPage = /^\/service-projects\/[0-9a-fA-F-]{36}$/.test(pathname);
|
const isServiceProjectPage = /^\/service-projects\/[0-9a-fA-F-]{36}$/.test(pathname);
|
||||||
const isAdvancePayment1 =
|
const isAdvancePayment1 =
|
||||||
/^\/advance-payment(\/[0-9a-fA-F-]{36})?$/.test(pathname);
|
/^\/advance-payment(\/[0-9a-fA-F-]{36})?$/.test(pathname);
|
||||||
|
|
||||||
|
|
||||||
return !(isDirectoryPath || isProfilePage || isExpensePage || isPaymentRequest || isRecurringExpense || isAdvancePayment ||isServiceProjectPage || isAdvancePayment1);
|
return !(isDirectoryPath || isProfilePage || isExpensePage || isPaymentRequest || isRecurringExpense || isAdvancePayment || isServiceProjectPage || isAdvancePayment1);
|
||||||
};
|
};
|
||||||
const allowedProjectStatusIds = [
|
const allowedProjectStatusIds = [
|
||||||
"603e994b-a27f-4e5d-a251-f3d69b0498ba",
|
"603e994b-a27f-4e5d-a251-f3d69b0498ba",
|
||||||
@ -79,8 +79,8 @@ const Header = () => {
|
|||||||
const projectsForDropdown = isDashboardPath
|
const projectsForDropdown = isDashboardPath
|
||||||
? projectNames
|
? projectNames
|
||||||
: projectNames?.filter((project) =>
|
: projectNames?.filter((project) =>
|
||||||
allowedProjectStatusIds.includes(project.projectStatusId)
|
allowedProjectStatusIds.includes(project.projectStatusId)
|
||||||
);
|
);
|
||||||
|
|
||||||
let currentProjectDisplayName;
|
let currentProjectDisplayName;
|
||||||
if (projectLoading) {
|
if (projectLoading) {
|
||||||
@ -196,63 +196,63 @@ const Header = () => {
|
|||||||
>
|
>
|
||||||
<div className="d-flex align-items-center">
|
<div className="d-flex align-items-center">
|
||||||
{showProjectDropdown(location.pathname) && (
|
{showProjectDropdown(location.pathname) && (
|
||||||
<div className="align-items-center">
|
<div className="align-items-center">
|
||||||
<i className="rounded-circle bx bx-building-house bx-sm-lg bx-md me-2"></i>
|
<i className="rounded-circle bx bx-building-house bx-sm-lg bx-md me-2"></i>
|
||||||
<div className="btn-group">
|
<div className="btn-group">
|
||||||
{shouldShowDropdown ? (
|
{shouldShowDropdown ? (
|
||||||
<button
|
<button
|
||||||
className={`btn btn-sm-sm btn-xl dropdown-toggle px-1`}
|
className={`btn btn-sm-sm btn-xl dropdown-toggle px-1`}
|
||||||
type="button"
|
type="button"
|
||||||
data-bs-toggle="dropdown"
|
data-bs-toggle="dropdown"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
>
|
|
||||||
{currentProjectDisplayName}
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
<span className="btn btn-sm-sm btn-xl px-1">
|
|
||||||
{currentProjectDisplayName}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{shouldShowDropdown &&
|
|
||||||
projectsForDropdown &&
|
|
||||||
projectsForDropdown.length > 0 && (
|
|
||||||
<ul
|
|
||||||
className="dropdown-menu"
|
|
||||||
style={{ overflow: "auto", maxHeight: "300px" }}
|
|
||||||
>
|
>
|
||||||
{(isDashboardPath|| isCollectionPath) &&(
|
{currentProjectDisplayName}
|
||||||
<li>
|
</button>
|
||||||
<button
|
) : (
|
||||||
className="dropdown-item"
|
<span className="btn btn-sm-sm btn-xl px-1">
|
||||||
onClick={() => handleProjectChange(null)}
|
{currentProjectDisplayName}
|
||||||
>
|
</span>
|
||||||
All Projects
|
)}
|
||||||
</button>
|
|
||||||
</li>
|
{shouldShowDropdown &&
|
||||||
)}
|
projectsForDropdown &&
|
||||||
{[...projectsForDropdown]
|
projectsForDropdown.length > 0 && (
|
||||||
.sort((a, b) => a?.name?.localeCompare(b.name))
|
<ul
|
||||||
.map((project) => (
|
className="dropdown-menu custom-scrollbar"
|
||||||
<li key={project?.id}>
|
style={{ overflow: "auto", maxHeight: "300px" }}
|
||||||
|
>
|
||||||
|
{(isDashboardPath || isCollectionPath) && (
|
||||||
|
<li>
|
||||||
<button
|
<button
|
||||||
className="dropdown-item"
|
className="dropdown-item"
|
||||||
onClick={() => handleProjectChange(project?.id)}
|
onClick={() => handleProjectChange(null)}
|
||||||
>
|
>
|
||||||
{project?.name}
|
All Projects
|
||||||
{project?.shortName && (
|
|
||||||
<span className="text-primary fw-semibold ms-1">
|
|
||||||
({project?.shortName})
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
))}
|
)}
|
||||||
</ul>
|
{[...projectsForDropdown]
|
||||||
)}
|
.sort((a, b) => a?.name?.localeCompare(b.name))
|
||||||
|
.map((project) => (
|
||||||
|
<li key={project?.id}>
|
||||||
|
<button
|
||||||
|
className="dropdown-item"
|
||||||
|
onClick={() => handleProjectChange(project?.id)}
|
||||||
|
>
|
||||||
|
{project?.name}
|
||||||
|
{project?.shortName && (
|
||||||
|
<span className="text-primary fw-semibold ms-1">
|
||||||
|
({project?.shortName})
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul className="navbar-nav flex-row align-items-center ms-md-auto">
|
<ul className="navbar-nav flex-row align-items-center ms-md-auto">
|
||||||
@ -402,7 +402,7 @@ const Header = () => {
|
|||||||
<li>
|
<li>
|
||||||
<div className="dropdown-divider"></div>
|
<div className="dropdown-divider"></div>
|
||||||
</li>
|
</li>
|
||||||
<li onClick={()=>onOpen()}>
|
<li onClick={() => onOpen()}>
|
||||||
{" "}
|
{" "}
|
||||||
<a
|
<a
|
||||||
className="dropdown-item cusor-pointer"
|
className="dropdown-item cusor-pointer"
|
||||||
@ -448,10 +448,10 @@ const Header = () => {
|
|||||||
<a
|
<a
|
||||||
aria-label="click to log out"
|
aria-label="click to log out"
|
||||||
className="dropdown-item cusor-pointer"
|
className="dropdown-item cusor-pointer"
|
||||||
onClick={()=>logout()}
|
onClick={() => logout()}
|
||||||
>
|
>
|
||||||
{logouting ? "Please Wait":<> <i className="bx bx-log-out me-2"></i>
|
{logouting ? "Please Wait" : <> <i className="bx bx-log-out me-2"></i>
|
||||||
<span className="align-middle">SignOut</span></>}
|
<span className="align-middle">SignOut</span></>}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -97,7 +97,7 @@ const DailyProgrssReport = () => {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="card card-fullscreen p-5">
|
<div className="card page-min-h p-5">
|
||||||
{data?.length > 0 && (
|
{data?.length > 0 && (
|
||||||
<div className="col-sm-4 col-md-3 col-12 text-start">
|
<div className="col-sm-4 col-md-3 col-12 text-start">
|
||||||
<AppFormController
|
<AppFormController
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user