Skip to content

Commit

Permalink
Small fixs (#647)
Browse files Browse the repository at this point in the history
* hide Ref/test/scrubber buttons if there is no diff

* Fix height of toolbar

* give the Ref/test/scrubber buttons a selected state

* Fix responsive scrubber

* Fix scrubber positions

* Prettier!

* prettier

* true prettier!

* Fix modal scrubber header

* Another round of prettier

* Another round of prettier

* Remove npm format script

* prettier ok

* bigger border status card
  • Loading branch information
mantovanig authored and garris committed Jan 28, 2018
1 parent 1525d02 commit a7d391d
Show file tree
Hide file tree
Showing 35 changed files with 425 additions and 419 deletions.
36 changes: 18 additions & 18 deletions compare/src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,61 @@ export const filterTests = status => {
return {
type: 'FILTER_TESTS',
status
}
}
};
};

export const findTests = value => {
return {
type: 'SEARCH_TESTS',
value
}
}
};
};

export const updateSettings = id => {
return {
type: 'UPDATE_SETTINGS',
id
}
}
};
};

export const toggleAllImages = value => {
return {
type: 'TOGGLE_ALL_IMAGES',
value
}
}
};
};

export const openModal = value => {
return {
type: 'OPEN_SCRUBBER_MODAL',
value
}
}
};
};

export const closeModal = value => {
return {
type: 'CLOSE_SCRUBBER_MODAL',
value
}
}
};
};

export const showScrubberTestImage = value => {
return {
type: 'SHOW_SCRUBBER_TEST_IMAGE',
value
}
}
};
};

export const showScrubberRefImage = value => {
return {
type: 'SHOW_SCRUBBER_REF_IMAGE',
value
}
}
};
};

export const showScrubber = value => {
return {
type: 'SHOW_SCRUBBER',
value
}
}
};
};
16 changes: 8 additions & 8 deletions compare/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react'
import styled from 'styled-components'
import { StickyContainer } from 'react-sticky'
import React from 'react';
import styled from 'styled-components';
import { StickyContainer } from 'react-sticky';

import Header from './ecosystems/Header'
import List from './ecosystems/List'
import ScrubberModal from './ecosystems/ScrubberModal'
import Header from './ecosystems/Header';
import List from './ecosystems/List';
import ScrubberModal from './ecosystems/ScrubberModal';

const Wrapper = styled.section`
padding: 0 30px;
`
`;

export default class App extends React.Component {
render() {
Expand All @@ -20,6 +20,6 @@ export default class App extends React.Component {
</Wrapper>
<ScrubberModal />
</StickyContainer>
)
);
}
}
12 changes: 6 additions & 6 deletions compare/src/components/atoms/ButtonFilter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'
import React from 'react';
import styled from 'styled-components';

import { colors, fonts, shadows } from '../../styles'
import { colors, fonts, shadows } from '../../styles';

const Button = styled.button`
font-size: 20px;
Expand Down Expand Up @@ -34,11 +34,11 @@ const Button = styled.button`
background-color: ${colors.red};
color: ${colors.white};
}
`
`;

export default class ButtonFilter extends React.Component {
render() {
let { count, label, status } = this.props
let { count, label, status } = this.props;

return (
<Button
Expand All @@ -48,6 +48,6 @@ export default class ButtonFilter extends React.Component {
>
{status !== 'all' ? count : ''} {label}
</Button>
)
);
}
}
14 changes: 7 additions & 7 deletions compare/src/components/atoms/ButtonSettings.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import styled from 'styled-components'
import React from 'react';
import styled from 'styled-components';

import { colors, fonts, shadows } from '../../styles'
import { colors, fonts, shadows } from '../../styles';

import settingsIcon from '../../assets/icons/settings.png'
import settingsIcon from '../../assets/icons/settings.png';

const Button = styled.button`
border: none;
Expand Down Expand Up @@ -45,17 +45,17 @@ const Button = styled.button`
font-family: ${fonts.latoRegular};
color: ${colors.secondaryText};
}
`
`;

export default class ButtonSettings extends React.Component {
render() {
let isActive = this.props.active ? 'active' : ''
let isActive = this.props.active ? 'active' : '';

return (
<Button onClick={this.props.onClick} className={isActive}>
<span className="icon" />
{/* <span className="label">settings</span> */}
</Button>
)
);
}
}
20 changes: 10 additions & 10 deletions compare/src/components/atoms/IdContainer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import { connect } from 'react-redux'
import styled from 'styled-components'
import React from 'react';
import { connect } from 'react-redux';
import styled from 'styled-components';

import { colors, fonts } from '../../styles'
import { colors, fonts } from '../../styles';

const IdTitle = styled.h3`
font-size: 14px;
Expand All @@ -27,20 +27,20 @@ const IdTitle = styled.h3`
left: 0;
top: -10px;
}
`
`;

class IdConfig extends React.Component {
render() {
return <IdTitle>{this.props.idConfig}</IdTitle>
return <IdTitle>{this.props.idConfig}</IdTitle>;
}
}

const mapStateToProps = state => {
return {
idConfig: state.suiteInfo.idConfig
}
}
};
};

const IdContainer = connect(mapStateToProps)(IdConfig)
const IdContainer = connect(mapStateToProps)(IdConfig);

export default IdContainer
export default IdContainer;
26 changes: 13 additions & 13 deletions compare/src/components/atoms/ImagePreview.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import { connect } from 'react-redux'
import styled from 'styled-components'
import React from 'react';
import { connect } from 'react-redux';
import styled from 'styled-components';

import { colors, fonts } from '../../styles'
import { colors, fonts } from '../../styles';

const Image = styled.img`
width: auto;
Expand All @@ -12,14 +12,14 @@ const Image = styled.img`
&:hover {
cursor: pointer;
}
`
`;

const Wrapper = styled.div`
flex: 1 1 auto;
padding: 0 25px;
padding-top: ${props => (props.withText ? '10px' : '20px')};
text-align: center;
`
`;

const Label = styled.span`
text-align: center;
Expand All @@ -31,27 +31,27 @@ const Label = styled.span`
padding: 5px 0;
padding-bottom: 15px;
font-size: 12px;
`
`;

class ImagePreview extends React.Component {
render() {
let { hidden, settings } = this.props
let { hidden, settings } = this.props;

return (
<Wrapper hidden={hidden} withText={settings.textInfo}>
<Label>{this.props.label}</Label>
<Image {...this.props} />
</Wrapper>
)
);
}
}

const mapStateToProps = state => {
return {
settings: state.layoutSettings
}
}
};
};

const ImagePreviewContainer = connect(mapStateToProps)(ImagePreview)
const ImagePreviewContainer = connect(mapStateToProps)(ImagePreview);

export default ImagePreviewContainer
export default ImagePreviewContainer;
22 changes: 11 additions & 11 deletions compare/src/components/atoms/ImageScrubber.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import styled from 'styled-components'
import TwentyTwenty from 'react-twentytwenty'
import React from 'react';
import styled from 'styled-components';
import TwentyTwenty from 'react-twentytwenty';

import { colors, fonts, shadows } from '../../styles'
import { colors, fonts, shadows } from '../../styles';

const ScrubberViewBtn = styled.button`
margin: 1em;
Expand All @@ -29,7 +29,7 @@ const ScrubberViewBtn = styled.button`
cursor: pointer;
box-shadow: ${props => (!props.selected ? shadows.shadow02 : '')};
}
`
`;

const Wrapper = styled.div`
height: 100%;
Expand All @@ -51,12 +51,12 @@ const Wrapper = styled.div`
.refImage {
width: 100%;
}
`
`;

const WrapTitle = styled.div`
display: flex;
justify-content: center;
`
`;

export default function ImageScrubber({
position,
Expand All @@ -75,23 +75,23 @@ export default function ImageScrubber({
<ScrubberViewBtn
selected={position === 100}
onClick={() => {
showScrubberRefImage()
showScrubberRefImage();
}}
>
REFERENCE
</ScrubberViewBtn>
<ScrubberViewBtn
selected={position === 0}
onClick={() => {
showScrubberTestImage()
showScrubberTestImage();
}}
>
TEST
</ScrubberViewBtn>
<ScrubberViewBtn
selected={position !== 100 && position !== 0}
onClick={() => {
showScrubber()
showScrubber();
}}
>
SCRUBBER
Expand All @@ -111,6 +111,6 @@ export default function ImageScrubber({
<div className="slider" />
</TwentyTwenty>
</Wrapper>
)
);
// }
}
14 changes: 7 additions & 7 deletions compare/src/components/atoms/InputTextSearch.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import { connect } from 'react-redux'
import styled from 'styled-components'
import React from 'react';
import { connect } from 'react-redux';
import styled from 'styled-components';

import { colors, fonts } from '../../styles'
import { colors, fonts } from '../../styles';

import searchIcon from '../../assets/icons/search.png'
import searchIcon from '../../assets/icons/search.png';

const Input = styled.input`
display: block;
Expand Down Expand Up @@ -33,7 +33,7 @@ const Input = styled.input`
font-style: italic;
color: ${colors.secondaryText};
}
`
`;

export default class ButtonFilter extends React.Component {
render() {
Expand All @@ -42,6 +42,6 @@ export default class ButtonFilter extends React.Component {
placeholder="Filter tests with search..."
onChange={this.props.onChange.bind(this)}
/>
)
);
}
}
Loading

0 comments on commit a7d391d

Please sign in to comment.