Skip to content

Commit

Permalink
refactor: eslint format
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Espinoza authored and Dennis Espinoza committed Feb 25, 2018
1 parent 2cffa10 commit d052b7a
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 61 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"parser": "babel-eslint",

"extends": ["prettier"],
"extends": [
"prettier",
"plugin:prettier/recommended"
],

"parserOptions": {
"ecmaVersion": 6,
Expand Down
6 changes: 2 additions & 4 deletions src/components/common/TechnologyLogo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const TechnologyLogo = props => {
return (
<div className={cls}>
<img className={classes.logo} src={logo} alt={name} />
<div className={classes.name}>
{name}
</div>
<div className={classes.name}>{name}</div>
</div>
);
};
Expand All @@ -31,7 +29,7 @@ TechnologyLogo.propTypes = {
/**
* Technology route to website.
*/
route: PropTypes.string,
route: PropTypes.string
};

export default withStyles(styles)(TechnologyLogo);
6 changes: 3 additions & 3 deletions src/components/common/TechnologyLogo/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default theme => ({
fontStyle: 'italic',
fontSize: 16,
lineHeight: '20px',
padding: [0, 10],
padding: [0, 10]
},
logo: {
width: 60,
Expand All @@ -23,10 +23,10 @@ export default theme => ({
'@media screen and (min-width: 48em)': {
root: {
width: '14.28%',
marginBottom: 45,
marginBottom: 45
},
name: {
padding: 0
}
},
}
});
12 changes: 6 additions & 6 deletions src/components/common/TopDrops/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ const TopDrops = props => {
return (
<div className={classes.root}>
<div className={classes.content}>
<div className={classes.segment}/>
<div className={classes.segment} />
</div>
<div className={classes.line}/>
<div className={classes.line} />
<div className={classes.dropsContainer}>
<div className="container">
<div className={classes.drops}>
<img src={dropLeftA} alt=""/>
<img className={classes.hideOnSmall} src={dropLeftB}/>
<img src={dropLeftA} alt="" />
<img className={classes.hideOnSmall} src={dropLeftB} />
</div>
<div className={classes.drops}>
<img className={classes.hideOnSmall} src={dropRightA}/>
<img src={dropRightB} alt=""/>
<img className={classes.hideOnSmall} src={dropRightA} />
<img src={dropRightB} alt="" />
</div>
</div>
</div>
Expand Down
15 changes: 8 additions & 7 deletions src/components/common/TopDrops/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export default theme => ({
// CONTENT AREA
content: {
overflow: 'hidden',
position: 'relative',
height: '100%',
width: '100%',
width: '100%'
},

// SEMI SPHERE
Expand All @@ -20,7 +21,7 @@ export default theme => ({
bottom: -15,
backgroundColor: '#fff',
position: 'absolute',
borderRadius: '50%',
borderRadius: '50%'
},

// CENTER LINE
Expand Down Expand Up @@ -49,7 +50,7 @@ export default theme => ({
bottom: 0,
left: 0,
'& .container': {
height: 215,
height: 215
}
},
drops: {
Expand Down Expand Up @@ -103,18 +104,18 @@ export default theme => ({
line: {
height: 160,
'&:after': {
height: 80,
height: 80
}
},

// DROPS CONTAINER
drops: {
width: 180,
height: 180,
marginTop: 10,
marginTop: 10
},
hideOnSmall: {
display: 'inline-block'
},
},
}
}
});
6 changes: 3 additions & 3 deletions src/components/forms/TextField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const TextField = props => {
onChange,
placeholder,
...fieldProps,
className: cx(classes.field, fieldProps.className),
className: cx(classes.field, fieldProps.className)
})}
{!!errorText && <div className={classes.errorText}>{errorText}</div>}
</div>
Expand Down Expand Up @@ -84,13 +84,13 @@ TextField.propTypes = {
/**
* Extra fields to pass to the encapsulated field element.
*/
fieldProps: PropTypes.object,
fieldProps: PropTypes.object
};

TextField.defaultProps = {
type: 'text',
palette: 'primary',
fieldProps: {},
fieldProps: {}
};

export default withStyles(styles)(TextField);
31 changes: 16 additions & 15 deletions src/components/forms/TextField/styles.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
export default (theme) => {
const getColor = props => props.reversed ? '#fff' : theme.palette.inverted.base;
export default theme => {
const getColor = props =>
props.reversed ? '#fff' : theme.palette.inverted.base;
return {
root: {
display: 'block',
display: 'block'
},
field: {
display: 'block',
Expand All @@ -17,12 +18,12 @@ export default (theme) => {
resize: 'none',
transition: 'border-color 200ms ease-out',

minHeight: props => props.isTextarea ? 16 * 3 : 'auto',
minHeight: props => (props.isTextarea ? 16 * 3 : 'auto'),
border: props => '2px solid ' + getColor(props),
color: props => getColor(props),

'&:focus': {
borderColor: props => theme.palette[props.palette].base,
borderColor: props => theme.palette[props.palette].base
},

// Remove browser/os appareance
Expand All @@ -33,41 +34,41 @@ export default (theme) => {
// Placeholder color
'&::-webkit-input-placeholder': {
opacity: 1,
color: props => getColor(props),
color: props => getColor(props)
},
'&::-moz-placeholder': {
opacity: 1,
color: props => getColor(props),
color: props => getColor(props)
},
'&:-ms-input-placeholder': {
opacity: 1,
color: props => getColor(props),
color: props => getColor(props)
},
'&:-moz-placeholder': {
opacity: 1,
color: props => getColor(props),
color: props => getColor(props)
},

// Autofill background color
'&:-webkit-autofill': {
'-webkit-box-shadow': '0 0 0 rgba(0, 0, 0, 0.001)',
'-webkit-box-shadow': '0 0 0 rgba(0, 0, 0, 0.001)'
},

// Input number arrows
'&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
'-webkit-appearance': 'none',
margin: 0,
margin: 0
},
'&[type="number"]': {
'-moz-appearance': 'textfield',
},
'-moz-appearance': 'textfield'
}
},
errorText: {
padding: [4, 0, 0, 14],
lineHeight: 1.2,
fontFamily: theme.typography.secondary,
fontStyle: 'italic',
color: theme.palette.alert.base,
},
color: theme.palette.alert.base
}
};
};
51 changes: 29 additions & 22 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import imagePatternDots from '../assets/images/patterns/dots.png';
import { Header, Footer, TopDrops, TechnologyLogo } from '../components';
import technologies from '../data/technologies.json';

const styles = (theme) => ({
const styles = theme => ({
root: {
display: 'flex',
minHeight: '100vh',
flexDirection: 'column',
flexDirection: 'column'
},

// HERO
hero: {
backgroundColor: theme.palette.inverted.base,
backgroundImage: `url(${imagePatternDots})`,
backgroundImage: `url(${imagePatternDots})`
},
heading: {
margin: 'auto',
Expand All @@ -27,8 +27,8 @@ const styles = (theme) => ({
position: 'relative',
color: '#fff',
'& h1': {
fontSize: 24,
},
fontSize: 24
}
},
headingDescription: {
fontFamily: theme.typography.secondary,
Expand All @@ -46,12 +46,12 @@ const styles = (theme) => ({
fontFamily: theme.typography.secondary,
fontStyle: 'italic',
textAlign: 'center',
color: '#fff',
color: '#fff'
},

// MAIN
main: {
flex: '1',
flex: '1'
},

// LOGOS
Expand All @@ -65,7 +65,7 @@ const styles = (theme) => ({
// FOOTER
footer: {
backgroundColor: theme.palette.inverted.base,
backgroundImage: `url(${imagePatternDots})`,
backgroundImage: `url(${imagePatternDots})`
},

// small +
Expand All @@ -74,13 +74,13 @@ const styles = (theme) => ({
padding: [80, 20, 0],
width: '76%',
'& h1': {
fontSize: 32,
},
fontSize: 32
}
},
headingDescription: {
bottom: -100,
bottom: -100
}
},
}
});

const HomePage = ({ classes }) => (
Expand All @@ -89,37 +89,44 @@ const HomePage = ({ classes }) => (
<title>Real World React</title>
</Helmet>
<div className={classes.root}>

{/* HERO */}
<div className={classes.hero}>
<Header reversed />
<div className='container'>
<div className="container">
<div className={classes.heading}>
<h1>
We are a professional services and consulting firm specializing
in <span className='text-inverted background-secondary'>&nbsp;modern front-end tools&nbsp;</span> and
serverless architecture.
We are a professional services and consulting firm specializing in{' '}
<span className="text-inverted background-secondary">
&nbsp;modern front-end tools&nbsp;
</span>{' '}
and serverless architecture.
</h1>
<div className={classes.headingDescription}>Fig. 1 - Our fields of speciality</div>
<div className={classes.headingDescription}>
Fig. 1 - Our fields of speciality
</div>
</div>
</div>
<TopDrops/>
<TopDrops />
</div>

{/* MAIN */}
<div className={classes.main}>
<div className={cx(classes.logos, 'container')}>
{technologies.map((item, key) => (
<TechnologyLogo name={item.name} logo={item.logo} route={item.route} key={key}/>
<TechnologyLogo
name={item.name}
logo={item.logo}
route={item.route}
key={key}
/>
))}
</div>
</div>

{/* FOOTER */}
<div className={classes.footer}>
<Footer></Footer>
<Footer />
</div>

</div>
</div>
);
Expand Down

0 comments on commit d052b7a

Please sign in to comment.