X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/1933452553965a2066191eccaaa40943d6d5c5d8..83cc752d85a910c19ffaf5c74433fbf7fa76e038:/src/components/breadcrumbs/breadcrumbs.tsx diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx index 4868e137..20782330 100644 --- a/src/components/breadcrumbs/breadcrumbs.tsx +++ b/src/components/breadcrumbs/breadcrumbs.tsx @@ -6,64 +6,60 @@ import * as 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'; export interface Breadcrumb { label: string; } -interface BreadcrumbsProps { +type CssRules = "item" | "currentItem" | "label"; + +const styles: StyleRulesCallback = theme => ({ + item: { + opacity: 0.6 + }, + currentItem: { + opacity: 1 + }, + label: { + textTransform: "none" + } +}); + +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 => { - const { unit } = theme.spacing; - return { - item: { - opacity: 0.6 - }, - currentItem: { - opacity: 1 - }, - label: { - textTransform: "none" - } - }; -}; - -export default withStyles(styles)(Breadcrumbs); - + className={classes.label}> + {item.label} + + + + {!isLastItem && } + + ); + }) + } + +);