17526: Use codesnippet component on webdav dialog wget command for monospace
authorStephen Smith <stephen@curii.com>
Thu, 29 Jul 2021 14:50:49 +0000 (10:50 -0400)
committerStephen Smith <stephen@curii.com>
Thu, 29 Jul 2021 14:50:49 +0000 (10:50 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx

index 73c89621880fdface4d805c556d3ea7c707f68f8..7255e756ce2919fbd8c17b5db96507234e25e0de 100644 (file)
@@ -10,8 +10,9 @@ import { WithDialogProps } from 'store/dialog/with-dialog';
 import { compose } from 'redux';
 import { DetailsAttribute } from "components/details-attribute/details-attribute";
 import { DownloadIcon } from "components/icon/icon";
+import { DefaultCodeSnippet } from "components/default-code-snippet/default-code-snippet";
 
-export type CssRules = 'details' | 'downloadButton';
+export type CssRules = 'details' | 'downloadButton' | 'detailsAttrValWithCode';
 
 const styles: StyleRulesCallback<CssRules> = theme => ({
     details: {
@@ -20,6 +21,10 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
     },
     downloadButton: {
         marginTop: theme.spacing.unit * 2,
+    },
+    detailsAttrValWithCode: {
+        display: "flex",
+        alignItems: "center",
     }
 });
 
@@ -258,8 +263,11 @@ export const WebDavS3InfoDialog = compose(
 
                     <DetailsAttribute
                         label='Wget command'
-                        value={wgetCommand}
-                        copyValue={wgetCommand} />
+                        copyValue={wgetCommand}
+                        classValue={props.classes.detailsAttrValWithCode}>
+                        <DefaultCodeSnippet
+                            lines={[wgetCommand]} />
+                    </DetailsAttribute>
 
                     <DetailsAttribute
                         label='Username'