Skip to content

Commit

Permalink
feat(content-explorer): update breadcrumb style and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tjiang-box committed Feb 7, 2025
1 parent b594e9e commit 35abcab
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 2 additions & 0 deletions i18n/en-US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ be.boxEditBlacklistedError = This file cannot be opened locally
be.boxEditErrorBlockedByPolicy = Local editing of this content has been disabled based on an access policy
# Message shown telling user how to install Box Tools
be.boxToolsInstallMessage = Install {boxTools} to open this file on your desktop
# Aria label for describing "breadcrumb"
be.breadcrumb.breadcrumbLabel = Breadcrumb
# Label for cancel action.
be.cancel = Cancel
# Label for choose action.
Expand Down
1 change: 0 additions & 1 deletion src/components/grid-view/GridViewSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ const GridViewSlider = ({ columnCount, gridMaxColumns, gridMinColumns, maxColumn
);
};

export { GridViewSlider as GridViewSliderBase };
export default GridViewSlider;
15 changes: 2 additions & 13 deletions src/components/grid-view/__tests__/GridViewSlider.test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import * as React from 'react';

import { GridViewSliderBase as GridViewSlider } from '../GridViewSlider';

const intl = {
formatMessage: message => message.defaultMessage,
};
import GridViewSlider from '../GridViewSlider';

const getWrapper = () =>
shallow(
<GridViewSlider
columnCount={4}
gridMaxColumns={7}
gridMinColumns={2}
intl={intl}
maxColumnCount={4}
onChange={() => {}}
/>,
<GridViewSlider columnCount={4} gridMaxColumns={7} gridMinColumns={2} maxColumnCount={4} onChange={() => {}} />,
);

describe('components/grid-view/GridViewSlider', () => {
Expand Down
4 changes: 4 additions & 0 deletions src/elements/common/breadcrumbs/Breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
color: var(--text-text-on-light);
white-space: nowrap;
text-overflow: ellipsis;

&:not(:last-child) {
color: var(--text-text-on-light-tertiary);
}
}
6 changes: 3 additions & 3 deletions src/elements/common/breadcrumbs/BreadcrumbDelimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import * as React from 'react';
import { PointerChevronRight } from '@box/blueprint-web-assets/icons/Fill';
import { Size3 } from '@box/blueprint-web-assets/tokens/tokens';
import { Gray50, Size3 } from '@box/blueprint-web-assets/tokens/tokens';
import type { Delimiter } from '../../../common/types/core';
import { DELIMITER_CARET, COLOR_999 } from '../../../constants';
import { DELIMITER_CARET } from '../../../constants';

type Props = {
delimiter?: Delimiter,
Expand All @@ -18,7 +18,7 @@ const BreadcrumbDelimiter = ({ delimiter }: Props) =>
delimiter === DELIMITER_CARET ? (
<PointerChevronRight
className="be-breadcrumb-seperator"
color={COLOR_999}
color={Gray50}
height={Size3}
role="presentation"
width={Size3}
Expand Down
4 changes: 3 additions & 1 deletion src/elements/common/breadcrumbs/BreadcrumbDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { DropdownMenu, IconButton } from '@box/blueprint-web';
import { Ellipsis } from '@box/blueprint-web-assets/icons/Fill';
import type { Crumb } from '../../../common/types/core';

import messages from '../messages';

type Props = {
className: string,
crumbs: Crumb[],
Expand All @@ -18,7 +20,7 @@ type Props = {
const BreadcrumbDropdown = ({ crumbs, onCrumbClick }: Props) => (
<DropdownMenu.Root>
<DropdownMenu.Trigger>
<IconButton icon={Ellipsis} />
<IconButton aria-label={messages.breadcrumbLabel.defaultMessage} icon={Ellipsis} />
</DropdownMenu.Trigger>
<DropdownMenu.Content>
{crumbs.map(({ id, name }: Crumb) => (
Expand Down
1 change: 0 additions & 1 deletion src/elements/common/breadcrumbs/Breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,4 @@ const Breadcrumbs = ({ rootId, crumbs, onCrumbClick, delimiter, isSmall = false
);
};

export { Breadcrumbs as BreadcrumbsBase };
export default Breadcrumbs;
4 changes: 2 additions & 2 deletions src/elements/common/breadcrumbs/__tests__/Breadcrumbs.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @flow
import { shallow } from 'enzyme';
import { BreadcrumbsBase } from '../Breadcrumbs';
import Breadcrumbs from '../Breadcrumbs';

describe('Breadcrumbs', () => {
const getWrapper = (props = {}) => shallow(BreadcrumbsBase(props));
const getWrapper = (props = {}) => shallow(Breadcrumbs(props));

test('should render "All Files" breadcrumb in localized string', () => {
const crumbs = [{ id: '0', name: 'All Files' }];
Expand Down
5 changes: 5 additions & 0 deletions src/elements/common/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ const messages = defineMessages({
description: 'Message shown when folder items are still fetching.',
defaultMessage: 'Please wait while the items load...',
},
breadcrumbLabel: {
id: 'be.breadcrumb.breadcrumbLabel',
description: 'Aria label for describing "breadcrumb"',
defaultMessage: 'Breadcrumb',
},
errorBreadcrumb: {
id: 'be.errorBreadcrumb',
description: 'Default label for signifying error in the sub header.',
Expand Down

0 comments on commit 35abcab

Please sign in to comment.