Skip to content

Commit

Permalink
truncate final path
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Jan 19, 2021
1 parent 659c157 commit 1075900
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { EuiBreadcrumb, EuiBetaBadge } from '@elastic/eui';
import React, { memo, useMemo } from 'react';
import { BetaHeader, ThemedBreadcrumbs } from './styles';
import { useColors } from '../use_colors';
import { GeneratedText } from '../generated_text';

/**
* Breadcrumb menu
Expand All @@ -21,7 +20,8 @@ export const Breadcrumbs = memo(function ({ breadcrumbs }: { breadcrumbs: EuiBre
const crumbsWithLastSubject: EuiBreadcrumb[] = useMemo(() => {
const lastcrumb = breadcrumbs.slice(-1).map((crumb) => {
crumb['data-test-subj'] = 'resolver:breadcrumbs:last';
crumb.text = <GeneratedText>{crumb.text}</GeneratedText>;
// Manually set here as setting truncate={true} on ThemedBreadcrumbs truncates all parts of the full path
crumb.truncate = true;
return crumb;
});
return [...breadcrumbs.slice(0, -1), ...lastcrumb];
Expand Down

0 comments on commit 1075900

Please sign in to comment.