Browse Source

Polish the DeviceInteraction error style

master
meriadec 7 years ago
parent
commit
6b68714ba6
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 15
      src/components/DeviceInteraction/components.js
  2. 2
      src/components/DeviceInteraction/index.js
  3. 1
      src/components/DeviceInteraction/stories.js

15
src/components/DeviceInteraction/components.js

@ -100,12 +100,21 @@ export const ErrorDescContainer = ({
error: Error, error: Error,
onRetry: void => void, onRetry: void => void,
}) => ( }) => (
<Box horizontal fontSize={3} color="alertRed" align="center" cursor="text" {...p}> <Box
horizontal
fontSize={3}
color="alertRed"
align="center"
cursor="text"
ff="Open Sans|SemiBold"
style={{ maxWidth: 500 }}
{...p}
>
<IconExclamationCircle size={16} /> <IconExclamationCircle size={16} />
<Box ml={1}> <Box ml={2} mr={1} shrink grow style={{ maxWidth: 300 }}>
<TranslatedError error={error} /> <TranslatedError error={error} />
</Box> </Box>
<FakeLink ml={1} underline color="alertRed" onClick={onRetry}> <FakeLink ml="auto" underline color="alertRed" onClick={onRetry}>
{'Retry'} {'Retry'}
</FakeLink> </FakeLink>
</Box> </Box>

2
src/components/DeviceInteraction/index.js

@ -107,7 +107,7 @@ class DeviceInteraction extends PureComponent<Props, State> {
) )
})} })}
{error && {error &&
shouldRenderRetry && <ErrorDescContainer error={error} onRetry={this.reset} mt={2} />} shouldRenderRetry && <ErrorDescContainer error={error} onRetry={this.reset} mt={4} />}
</Box> </Box>
) )
} }

1
src/components/DeviceInteraction/stories.js

@ -34,6 +34,7 @@ class Wrapper extends React.Component<any> {
{'reset'} {'reset'}
</button> </button>
<DeviceInteraction <DeviceInteraction
shouldRenderRetry
ref={n => (this._ref = n)} ref={n => (this._ref = n)}
steps={[ steps={[
{ {

Loading…
Cancel
Save