[ARVADOS-WORKBENCH2] updated: 1.1.4-50-g528b1f4

Git user git at public.curoverse.com
Wed Jun 13 04:39:48 EDT 2018


Summary of changes:
 src/components/breadcrumbs/breadcrumbs.tsx | 64 ++++++++++++++----------------
 1 file changed, 30 insertions(+), 34 deletions(-)

       via  528b1f4623fa22d956b8ac1652833fc375a0bfc1 (commit)
      from  a234ec2fdf7a257aa1a9268d892e2b6079d4ef55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 528b1f4623fa22d956b8ac1652833fc375a0bfc1
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Wed Jun 13 10:39:33 2018 +0200

    Transform breadcrumbs to stateless component
    
    Feature #13590
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx
index 7fa85ca..33ff33a 100644
--- a/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.tsx
@@ -16,48 +16,44 @@ interface BreadcrumbsProps {
     onClick: (breadcrumb: Breadcrumb) => any;
 }
 
-class Breadcrumbs extends React.Component<BreadcrumbsProps & WithStyles<CssRules>> {
-
-    render() {
-        const { classes, onClick } = this.props;
-        return <Grid container alignItems="center">
-            {
-                this.getInactiveItems().map((item, index) => (
-                    <React.Fragment key={index}>
-                        <Button
-                            color="inherit"
-                            className={classes.inactiveItem}
-                            onClick={() => onClick(item)}
-                        >
-                            {item.label}
-                        </Button>
-                        <ChevronRightIcon color="inherit" className={classes.inactiveItem} />
-                    </React.Fragment>
-                ))
-            }
-            {
-                this.getActiveItem().map((item, index) => (
+const Breadcrumbs: React.SFC<BreadcrumbsProps & WithStyles<CssRules>> = (props) => {
+    const { classes, onClick, items } = props;
+    return <Grid container alignItems="center">
+        {
+            getInactiveItems(items).map((item, index) => (
+                <React.Fragment key={index}>
                     <Button
                         color="inherit"
-                        key={index}
+                        className={classes.inactiveItem}
                         onClick={() => onClick(item)}
                     >
                         {item.label}
                     </Button>
-                ))
-            }
-        </Grid>;
-    }
-
-    getInactiveItems = () => {
-        return this.props.items.slice(0, -1);
-    }
+                    <ChevronRightIcon color="inherit" className={classes.inactiveItem} />
+                </React.Fragment>
+            ))
+        }
+        {
+            getActiveItem(items).map((item, index) => (
+                <Button
+                    color="inherit"
+                    key={index}
+                    onClick={() => onClick(item)}
+                >
+                    {item.label}
+                </Button>
+            ))
+        }
+    </Grid>;
+};
 
-    getActiveItem = () => {
-        return this.props.items.slice(-1);
-    }
+const getInactiveItems = (items: Breadcrumb[]) => {
+    return items.slice(0, -1);
+};
 
-}
+const getActiveItem = (items: Breadcrumb[]) => {
+    return items.slice(-1);
+};
 
 type CssRules = 'inactiveItem';
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list