X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b323a94f313671b44a066a2f91dea562e9464d10..e42867f560b3c2f4c09cf6a2c07c964c63714141:/src/components/breadcrumbs/breadcrumbs.tsx diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx index cfcfd407d9..3d668856ec 100644 --- a/src/components/breadcrumbs/breadcrumbs.tsx +++ b/src/components/breadcrumbs/breadcrumbs.tsx @@ -2,65 +2,79 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import { Button, Grid, StyleRulesCallback, WithStyles, Typography, Tooltip } from '@material-ui/core'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; import { withStyles } from '@material-ui/core'; +import { IllegalNamingWarning } from '../warning/warning'; +import { IconType } from 'components/icon/icon'; +import grey from '@material-ui/core/colors/grey'; export interface Breadcrumb { label: string; + icon?: IconType; } -interface BreadcrumbsProps { +type CssRules = "item" | "currentItem" | "label" | "icon"; + +const styles: StyleRulesCallback = theme => ({ + item: { + opacity: 0.6 + }, + currentItem: { + opacity: 1 + }, + label: { + textTransform: "none" + }, + icon: { + fontSize: 20, + color: grey["600"] + }, +}); + +export interface BreadcrumbsProps { items: Breadcrumb[]; onClick: (breadcrumb: Breadcrumb) => void; onContextMenu: (event: React.MouseEvent, breadcrumb: Breadcrumb) => void; } -const Breadcrumbs: React.SFC> = ({ classes, onClick, onContextMenu, items }) => { - return - { - items.map((item, index) => { - const isLastItem = index === items.length - 1; - return ( - - - - - {!isLastItem && } - - ); - }) - } - ; -}; - -type CssRules = "item" | "currentItem" | "label"; - -const styles: StyleRulesCallback = theme => { - return { - item: { - opacity: 0.6 - }, - currentItem: { - opacity: 1 - }, - label: { - textTransform: "none" - } - }; -}; - -export default withStyles(styles)(Breadcrumbs); - + className={classes.label}> + {item.label} + + + + {!isLastItem && } + + ); + }) + } + +);