Refactor variable names for clarity in NavigationDrawerItemForObjectMetadataItem

- Updated variable names to improve readability and maintainability, changing `isOnRecordShowPage` to `isOnObjectRecordShowPage` and `isOnIndexPage` to `isOnObjectIndexPage`.
- Enhanced the logic for determining the current path matching object metadata, contributing to clearer navigation handling within the component.
This commit is contained in:
Abdul Rahman
2026-04-09 06:56:42 +05:30
parent 9f55948785
commit 6dbec4a7e2
@@ -98,18 +98,19 @@ export const NavigationDrawerItemForObjectMetadataItem = ({
const activeNavigationItem = useAtomStateValue(activeNavigationItemState);
const setActiveNavigationItem = useSetAtomState(activeNavigationItemState);
const isOnRecordShowPage = matchesRecordShowPathForObject(
const isOnObjectRecordShowPage = matchesRecordShowPathForObject(
currentPath,
objectMetadataItem.nameSingular,
);
const isOnIndexPage =
const isOnObjectIndexPage =
currentPath ===
getAppPath(AppPath.RecordIndexPage, {
objectNamePlural: objectMetadataItem.namePlural,
});
const isCurrentPathMatchingObject = isOnIndexPage || isOnRecordShowPage;
const isCurrentPathMatchingObject =
isOnObjectIndexPage || isOnObjectRecordShowPage;
const shouldUseExplicitActiveItem =
isDefined(activeNavigationItem) &&
@@ -131,7 +132,7 @@ export const NavigationDrawerItemForObjectMetadataItem = ({
const isActiveByUrl =
matchesNavigationMenuItemLink ||
(isObject && isOnRecordShowPage) ||
(isObject && isOnObjectRecordShowPage) ||
(!hasCustomLink && isCurrentPathMatchingObject);
const isActive =