Skip to content

Commit

Permalink
feat: remove click navigation on crumbs
Browse files Browse the repository at this point in the history
refs: SHELL-81 (#300)
  • Loading branch information
rodleyorosa authored Aug 7, 2023
1 parent a0b62a4 commit 5952ded
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/settings/components/settings-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ import {
Text
} from '@zextras/carbonio-design-system';
import { useHistory, useParams } from 'react-router-dom';
import styled from 'styled-components';

import { SETTINGS_APP_ID } from '../../constants';
import { getT } from '../../store/i18n';
import { RouteLeavingGuard, RouteLeavingGuardProps } from '../../ui-extras/nav-guard';

const CustomBreadcrumbs = styled(Breadcrumbs)`
.breadcrumbCrumb {
cursor: default;
}
`;

export type SettingsHeaderProps = {
title: string;
onSave: RouteLeavingGuardProps['onSave'];
Expand All @@ -38,15 +44,15 @@ const SettingsHeader = ({ onSave, onCancel, isDirty, title }: SettingsHeaderProp
{
id: 'settings',
label: t('settings.app', 'Settings'),
onClick: (): void => history.push(`/${SETTINGS_APP_ID}/`)
className: 'breadcrumbCrumb'
},
{
id: 'general',
label: title,
onClick: (): void => history.push(`/${SETTINGS_APP_ID}/`)
className: 'breadcrumbCrumb'
}
],
[history, t, title]
[t, title]
);

const search: string | undefined = history.location?.search;
Expand Down Expand Up @@ -87,7 +93,7 @@ const SettingsHeader = ({ onSave, onCancel, isDirty, title }: SettingsHeaderProp
width="50%"
crossAlignment="flex-start"
>
<Breadcrumbs crumbs={crumbs} />
<CustomBreadcrumbs crumbs={crumbs} />
</Row>
<Row
padding={{ all: 'small' }}
Expand Down

0 comments on commit 5952ded

Please sign in to comment.