From deb1a8436f9d34712e4c968800c62676a1a745e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Moreira?= Date: Wed, 30 May 2018 15:02:29 +0100 Subject: [PATCH] feat(instances): user scripts responsive designs --- .../instance-steps/src/user-script/index.js | 88 ++++++++++--------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/packages/instance-steps/src/user-script/index.js b/packages/instance-steps/src/user-script/index.js index d007edd5..7dea3b73 100644 --- a/packages/instance-steps/src/user-script/index.js +++ b/packages/instance-steps/src/user-script/index.js @@ -1,4 +1,5 @@ import React, { Fragment } from 'react'; +import { withTheme } from 'styled-components'; import { Margin } from 'styled-components-spacing'; import { compose } from 'react-apollo'; import { Link } from 'react-router-dom'; @@ -30,47 +31,52 @@ const UserScript = ({ handleChangeOpenForm, handleSubmit, handleEdit, + theme = {}, ...props -}) => ( - - }>User script - - Insert code to execute when the machine starts (first boot only for KVM, - every boot for infrastructure containers). - - - - - - {({ next }) => ( - - - {props => ( - - - - - - - )} - - - )} - - -); +}) => { + const mobile = theme.screen === 'mobile'; + return ( + + }>User script + + Insert code to execute when the machine starts (first boot only for KVM, + every boot for infrastructure containers). + + + + + + {({ next }) => ( + + + {props => ( + + + + + + + )} + + + )} + + + ); +}; export default compose( connect( @@ -100,4 +106,4 @@ export default compose( } }) ) -)(UserScript); +)(withTheme(({ ...rest }) => ));