Skip to content

Commit

Permalink
fix(human-app): improvements after review
Browse files Browse the repository at this point in the history
  • Loading branch information
rozekmichal committed Sep 23, 2024
1 parent 3c97187 commit c2ea9c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { routerPaths } from '@/router/router-paths';

export const workerDrawerTopMenuItems = (
addressRegistered: boolean,
hasSiteKey: boolean
labelingEnabled: boolean
): TopMenuItem[] => {
return [
<Grid
Expand All @@ -29,7 +29,7 @@ export const workerDrawerTopMenuItems = (
</Grid>,
{
label: t('components.DrawerNavigation.captchaLabelling'),
link: hasSiteKey
link: labelingEnabled
? routerPaths.worker.HcaptchaLabeling
: routerPaths.worker.enableLabeler,
disabled: !addressRegistered,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function DrawerNavigation({
}

const { link, label, disabled, href, onClick } = item;
const isActive = link && location.pathname === link;
const isActive = Boolean(link && location.pathname === link);

return (
<ListItem disablePadding key={link}>
Expand All @@ -126,10 +126,11 @@ export function DrawerNavigation({
navigate(link);
}
}}
selected={isActive}
sx={{
backgroundColor: isActive
? colorPalette.chip.main
: 'transparent',
'&.Mui-selected': {
backgroundColor: colorPalette.primary.shades,
},
}}
>
<Stack
Expand Down Expand Up @@ -184,10 +185,11 @@ export function DrawerNavigation({
navigate(link);
}
}}
selected={isActive}
sx={{
backgroundColor: isActive
? colorPalette.chip.main
: 'transparent',
'&.Mui-selected': {
backgroundColor: colorPalette.primary.shades,
},
}}
>
<Stack
Expand Down
2 changes: 2 additions & 0 deletions packages/apps/human-app/frontend/src/styles/color-palette.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const colorPalette = {
white: '#FFFFFF',
black: '#000000',

text: {
primary: '#320A8D',
secondary: '#858EC6',
Expand All @@ -12,6 +13,7 @@ export const colorPalette = {
light: '#6309FF',
dark: '#100735',
contrastText: '#F9FAFF',
shades: '#DADEF0CC',
},
secondary: {
main: '#6309FF',
Expand Down

0 comments on commit c2ea9c6

Please sign in to comment.