Skip to content

Commit

Permalink
feat: use menu label as title
Browse files Browse the repository at this point in the history
  • Loading branch information
CarinaDraganJW committed Sep 26, 2024
1 parent a4a5344 commit 97ca27f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/utils/urlFormatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ export const contentListURL = (id: string, title?: string) => {
return createPath(PATH_CONTENT_LIST, { id, title: title ? slugify(title) : undefined });
};

export const determinePath = ({ type, contentId }: { type: AppMenuType | undefined; contentId: string }) => {
export const determinePath = ({ type, contentId, label }: { type: AppMenuType | undefined; contentId: string; label?: string }) => {
switch (type) {
case APP_CONFIG_ITEM_TYPE.content_list:
return contentListURL(contentId);
case APP_CONFIG_ITEM_TYPE.media:
return mediaURL({ id: contentId });
return mediaURL({ id: contentId, title: label });
case APP_CONFIG_ITEM_TYPE.playlist:
return playlistURL(contentId);
default:
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/containers/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Layout = () => {
{ label: t('home'), to: '/' },
...menu.map(({ label, contentId, type }) => ({
label,
to: determinePath({ type, contentId }),
to: determinePath({ type, contentId, label }),
})),
];

Expand Down

0 comments on commit 97ca27f

Please sign in to comment.