Skip to content

Commit 95cf7a2

Browse files
authored
Merge pull request #1215 from topcoder-platform/pm-1503_4
fix(PM-1503): removed breadcrumb for non admin users
2 parents 3efd6b5 + 6db69ee commit 95cf7a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/apps/review/src/pages/scorecards/ViewScorecardPage/ViewScorecardPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ const ViewScorecardPage: FC = () => {
2020
const { profile }: ProfileContextData = useContext(profileContext)
2121
const isAdmin = profile?.roles.includes(UserRole.administrator)
2222
const breadCrumb = useMemo(
23-
() => [{ index: 1, label: 'Scorecards', path: '/scorecard' }, { index: 2, label: 'Scorecards Details' }],
24-
[],
23+
() => ((profile && isAdmin)
24+
? [{ index: 1, label: 'Scorecards', path: '/scorecard' }, { index: 2, label: 'Scorecards Details' }]
25+
: []
26+
),
27+
[profile, isAdmin],
2528
)
2629

2730
const scorecardQuery = useFetchScorecard(scorecardId, true)

0 commit comments

Comments
 (0)