13494: Enhances collection versions browser's layout.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 18 Nov 2020 15:19:35 +0000 (12:19 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 18 Nov 2020 15:19:35 +0000 (12:19 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

src/views-components/details-panel/collection-details.tsx

index 51b09b4faa48e43bf46f85088212b669bba9ce91..500b0506750f50a88aad3fd92500bbc5f514b71a 100644 (file)
@@ -15,15 +15,15 @@ import { formatDate, formatFileSize } from '~/common/formatters';
 import { Dispatch } from 'redux';
 import { navigateTo } from '~/store/navigation/navigation-action';
 
-export type CssRules = 'versionBrowserHeader' | 'selectedVersion';
+export type CssRules = 'versionBrowserHeader' | 'versionBrowserItem';
 
 const styles: StyleRulesCallback<CssRules> = theme => ({
     versionBrowserHeader: {
         textAlign: 'center',
-        fontWeight: 'bold'
+        fontWeight: 'bold',
     },
-    selectedVersion: {
-        fontWeight: 'bold'
+    versionBrowserItem: {
+        textAlign: 'center',
     }
 });
 
@@ -85,38 +85,47 @@ const CollectionVersionBrowser = withStyles(styles)(
     connect(mapStateToProps, mapDispatchToProps)(
         ({ currentCollection, versions, showVersion, classes }: CollectionVersionBrowserProps & CollectionVersionBrowserDispatchProps & WithStyles<CssRules>) => {
             return <>
-                <Grid container justify="space-between">
-                    <Typography variant="caption" className={classes.versionBrowserHeader}>
-                        Version
-                    </Typography>
-                    <Typography variant="caption" className={classes.versionBrowserHeader}>
-                        Size
-                    </Typography>
-                    <Typography variant="caption" className={classes.versionBrowserHeader}>
-                        Date
-                    </Typography>
-                </Grid>
+                <Grid container>
+                    <Grid item xs={2}>
+                        <Typography variant="caption" className={classes.versionBrowserHeader}>
+                            Nr
+                        </Typography>
+                    </Grid>
+                    <Grid item xs={4}>
+                        <Typography variant="caption" className={classes.versionBrowserHeader}>
+                            Size
+                        </Typography>
+                    </Grid>
+                    <Grid item xs={6}>
+                        <Typography variant="caption" className={classes.versionBrowserHeader}>
+                            Date
+                        </Typography>
+                    </Grid>
                 { versions.map(item => {
                     const isSelectedVersion = !!(currentCollection && currentCollection.uuid === item.uuid);
                     return (
-                        <ListItem button
-                            className={isSelectedVersion ? 'selectedVersion' : ''}
+                        <ListItem button style={{padding: '4px'}}
                             key={item.version}
                             onClick={e => showVersion(item)}
                             selected={isSelectedVersion}>
-                            <Grid container justify="space-between">
-                                <Typography variant="caption">
+                            <Grid item xs={2}>
+                                <Typography variant="caption" className={classes.versionBrowserItem}>
                                     {item.version}
                                 </Typography>
-                                <Typography variant="caption">
+                            </Grid>
+                            <Grid item xs={4}>
+                                <Typography variant="caption" className={classes.versionBrowserItem}>
                                     {formatFileSize(item.fileSizeTotal)}
                                 </Typography>
-                                <Typography variant="caption">
+                            </Grid>
+                            <Grid item xs={6}>
+                                <Typography variant="caption" className={classes.versionBrowserItem}>
                                     {formatDate(item.modifiedAt)}
                                 </Typography>
                             </Grid>
                         </ListItem>
                     );
                 })}
+                </Grid>
             </>;
         }));
\ No newline at end of file