From 470e836f622254a57100bcc7014d6bd9406f433f Mon Sep 17 00:00:00 2001 From: Gabriele Mantovani Date: Tue, 31 Oct 2017 10:18:07 +0100 Subject: [PATCH] Add report settings Toggle text info --- compare/src/components/atoms/ImagePreview.js | 21 ++++++++++++++----- compare/src/components/atoms/TextDetails.js | 18 +++++++++++++--- .../src/components/molecules/SettingsPopup.js | 11 +++++++++- .../src/components/molecules/TestImages.js | 2 -- compare/src/reducers/layoutSettings.js | 14 +++++-------- compare/src/store.js | 1 + 6 files changed, 47 insertions(+), 20 deletions(-) diff --git a/compare/src/components/atoms/ImagePreview.js b/compare/src/components/atoms/ImagePreview.js index 644bee6f3..6e0d181c3 100644 --- a/compare/src/components/atoms/ImagePreview.js +++ b/compare/src/components/atoms/ImagePreview.js @@ -1,4 +1,5 @@ import React from 'react' +import { connect } from 'react-redux' import styled from 'styled-components' import { colors, fonts } from '../../styles' @@ -6,7 +7,7 @@ import { colors, fonts } from '../../styles' const Image = styled.img` width: auto; max-width: 100%; - max-height: 150px; + max-height: ${props => (props.settings.textInfo ? '150px' : '300px')}; &:hover { cursor: pointer; @@ -16,7 +17,7 @@ const Image = styled.img` const Wrapper = styled.div` flex: 1 1 auto; padding: 0 25px; - padding-top: 20px; + padding-top: ${props => (props.withText ? '20px' : '60px')}; text-align: center; ` @@ -32,15 +33,25 @@ const Label = styled.span` font-size: 12px; ` -export default class ImagePreview extends React.Component { +class ImagePreview extends React.Component { render() { - let { hidden } = this.props + let { hidden, settings } = this.props return ( -