Skip to content

Commit

Permalink
feat(project): add custom menu label to sidebar (#637)
Browse files Browse the repository at this point in the history
* feat(project): add custom menu label to sidebar

* refactor(home): add translated title to aria-label
  • Loading branch information
royschut authored Nov 7, 2024
1 parent adf388c commit b73ae54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ui-react/src/containers/ShelfList/ShelfList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ShelfList = ({ rows }: Props) => {
key={`${index}_${playlist.id}`}
className={classNames(styles.shelfContainer, { [styles.featured]: isFeatured })}
data-testid={testId(`shelf-${isFeatured ? 'featured' : type === 'playlist' ? slugify(translatedTitle) : type}`)}
aria-label={title || playlist?.title}
aria-label={translatedTitle}
>
<Fade duration={250} delay={index * 33} open>
<ShelfComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const SidebarUserActions = ({
};

const SidebarContainer = () => {
const { t } = useTranslation('common');
const { t, i18n } = useTranslation('common');
const language = i18n.language;
const navigate = useNavigate();
const location = useLocation();

Expand Down Expand Up @@ -82,9 +83,9 @@ const SidebarContainer = () => {
<li>
<MenuButton label={t('home')} to="/" />
</li>
{menu.map(({ contentId, type, label }) => (
{menu.map(({ contentId, type, label, custom }) => (
<li key={contentId}>
<MenuButton label={label} to={determinePath({ type, contentId })} />
<MenuButton label={custom?.[`label-${language}`] || label} to={determinePath({ type, contentId })} />
</li>
))}
</ul>
Expand Down

0 comments on commit b73ae54

Please sign in to comment.