fix: apply styles

This commit is contained in:
Luis Félix 2019-11-13 17:44:56 +00:00 committed by Josh Harvey
parent 0d9d54efaf
commit 769822fce9
14 changed files with 120 additions and 96 deletions

View file

@ -17,14 +17,14 @@ const { h4 } = typographyStyles
const styles = { const styles = {
popoverContent: { popoverContent: {
minWidth: 315 width: 272
}, },
popoverHeader: { popoverHeader: {
extend: h4, extend: h4,
padding: [[20, 15, 0, 15]] padding: [[15, 15, 0, 15]]
}, },
radioButtonsContainer: { radioButtonsContainer: {
padding: [[10, 15, 10, 15]] padding: [[5, 15, 5, 15]]
}, },
radioButtons: { radioButtons: {
display: 'flex', display: 'flex',
@ -41,7 +41,7 @@ const styles = {
height: 0 height: 0
}, },
download: { download: {
padding: [[30, 15, 30, 15]] padding: [[10, 15]]
} }
} }

View file

@ -1,6 +1,8 @@
import React from 'react' import React from 'react'
import { makeStyles, Popover as MaterialPopover } from '@material-ui/core' import { makeStyles, Popover as MaterialPopover } from '@material-ui/core'
const arrowHeight = 10
const styles = { const styles = {
arrow: { arrow: {
width: 0, width: 0,
@ -8,12 +10,12 @@ const styles = {
position: 'absolute', position: 'absolute',
borderStyle: 'solid', borderStyle: 'solid',
margin: 5, margin: 5,
borderWidth: [[0, 15, 18, 15]], borderWidth: [[0, 15, arrowHeight, 15]],
borderLeftColor: 'transparent', borderLeftColor: 'transparent',
borderRightColor: 'transparent', borderRightColor: 'transparent',
borderTopColor: 'transparent', borderTopColor: 'transparent',
top: -18, top: arrowHeight * -1,
left: 138, left: 116,
marginTop: 0, marginTop: 0,
marginBottom: 0, marginBottom: 0,
borderColor: '#ffffff' borderColor: '#ffffff'
@ -36,7 +38,7 @@ const Popover = ({ children, ...props }) => {
{...props} {...props}
> >
{children} {children}
<div class={classes.arrow} /> <div className={classes.arrow} />
</MaterialPopover> </MaterialPopover>
) )
} }

View file

@ -3,32 +3,35 @@ import { floor, lowerCase, startCase } from 'lodash/fp'
import { makeStyles } from '@material-ui/core' import { makeStyles } from '@material-ui/core'
import classnames from 'classnames' import classnames from 'classnames'
import { spring3, spring2, mistyRose, tomato, comet } from '../styling/variables' import { secondaryColorLighter, secondaryColorDarker, offErrorColor, errorColor, offColor } from '../styling/variables'
import typographyStyles from './typography/styles' import typographyStyles from './typography/styles'
const { label } = typographyStyles const { label1 } = typographyStyles
const styles = { const styles = {
uptimeContainer: { uptimeContainer: {
display: 'inline-block', display: 'inline-block',
minWidth: 120, minWidth: 104,
margin: '0 20px 0 20px' margin: [[0, 20]]
}, },
name: { name: {
paddingLeft: 8, extend: label1,
color: comet paddingLeft: 4,
color: offColor
}, },
uptime: { uptime: {
extend: label, extend: label1,
textAlign: 'center', height: 24,
padding: 4 display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}, },
running: { running: {
backgroundColor: spring3, backgroundColor: secondaryColorLighter,
color: spring2 color: secondaryColorDarker
}, },
notRunning: { notRunning: {
backgroundColor: mistyRose, backgroundColor: offErrorColor,
color: tomato color: errorColor
} }
} }

View file

@ -19,7 +19,7 @@ const colors = (color1, color2, color3) => {
} }
} }
const buttonHeight = 45 const buttonHeight = 32
export default { export default {
baseButton: { baseButton: {

View file

@ -6,8 +6,6 @@ import baseButtonStyles from './BaseButton.styles'
const { baseButton, primary } = baseButtonStyles const { baseButton, primary } = baseButtonStyles
const svgSize = 25
const styles = { const styles = {
featureButton: { featureButton: {
extend: baseButton, extend: baseButton,
@ -17,11 +15,7 @@ const styles = {
}, },
primary, primary,
buttonIcon: { buttonIcon: {
margin: 'auto', margin: 'auto'
'& svg': {
width: svgSize,
height: svgSize
}
}, },
buttonIconActive: {} // required to extend primary buttonIconActive: {} // required to extend primary
} }

View file

@ -4,18 +4,25 @@ import { toInteger } from 'lodash/fp'
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import { ReactComponent as Arrow } from '../../styling/icons/arrow/month_change.svg' import { ReactComponent as Arrow } from '../../styling/icons/arrow/month_change.svg'
import { primaryColor, zircon, fontSecondary } from '../../styling/variables' import { primaryColor, zircon } from '../../styling/variables'
import typographyStyles from '../typography/styles' import typographyStyles from '../typography/styles'
import Tile from './Tile' import Tile from './Tile'
const { label2 } = typographyStyles const { p, label2 } = typographyStyles
const styles = { const styles = {
wrapper: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center'
},
navbar: { navbar: {
extend: p,
display: 'flex', display: 'flex',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
width: '100%',
padding: [[15, 15]], padding: [[15, 15]],
color: primaryColor, color: primaryColor,
'& button': { '& button': {
@ -34,13 +41,11 @@ const styles = {
position: 'absolute', position: 'absolute',
left: 0 left: 0
} }
}, }
fontFamily: fontSecondary,
fontSize: 16,
fontWeight: 500
}, },
table: { table: {
borderCollapse: 'collapse', borderCollapse: 'collapse',
width: '100%',
color: primaryColor, color: primaryColor,
'& tr': { '& tr': {
'&:first-child': { '&:first-child': {

View file

@ -8,11 +8,12 @@ import { ReactComponent as Arrow } from '../../styling/icons/arrow/download_logs
import { primaryColor, offColor, zircon } from '../../styling/variables' import { primaryColor, offColor, zircon } from '../../styling/variables'
import typographyStyles from '../typography/styles' import typographyStyles from '../typography/styles'
const { info1, label, label3 } = typographyStyles const { info1, label1, label2 } = typographyStyles
const dateContainerStyles = { const dateContainerStyles = {
wrapper: { wrapper: {
minWidth: 118 height: 46,
width: 99
}, },
container: { container: {
display: 'flex' display: 'flex'
@ -22,20 +23,23 @@ const dateContainerStyles = {
flexDirection: 'column' flexDirection: 'column'
}, },
label: { label: {
extend: label, extend: label1,
lineHeight: 1.33,
color: primaryColor color: primaryColor
}, },
bigNumber: { bigNumber: {
extend: info1, extend: info1,
lineHeight: 1,
marginRight: 7 marginRight: 7
}, },
monthYear: { monthYear: {
extend: label3, extend: label2,
lineHeight: 1.17,
color: primaryColor color: primaryColor
}, },
weekDay: { weekDay: {
extend: label, extend: label1,
lineHeight: 1, lineHeight: 1.33,
color: offColor color: offColor
} }
} }
@ -68,17 +72,18 @@ const styles = {
borderRadius: 10 borderRadius: 10
}, },
dateThingyContainer: { dateThingyContainer: {
height: 80,
display: 'flex', display: 'flex',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center',
position: 'relative',
backgroundColor: zircon, backgroundColor: zircon,
padding: [[5, 15, 0, 15]] padding: [[0, 15]],
minHeight: 70
}, },
arrowContainer: { arrowContainer: {
width: 39, position: 'absolute',
display: 'flex', left: 116,
alignSelf: 'center', top: 26
alignItems: 'center'
}, },
arrow: { arrow: {
margin: 'auto' margin: 'auto'

View file

@ -2,36 +2,33 @@ import React from 'react'
import classnames from 'classnames' import classnames from 'classnames'
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import { primaryColor, spring2, spring3, fontSecondary, disabledColor } from '../../styling/variables' import { primaryColor, spring2, spring3, disabledColor } from '../../styling/variables'
import typographyStyles from '../typography/styles'
const { label1 } = typographyStyles
const styles = { const styles = {
wrapper: { wrapper: {
width: 45,
height: 26, height: 26,
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
position: 'relative' position: 'relative',
overflow: 'hidden'
}, },
button: { button: {
extend: label1,
border: 'none', border: 'none',
width: '100%',
height: '100%',
cursor: 'pointer', cursor: 'pointer',
padding: 0,
backgroundColor: 'transparent', backgroundColor: 'transparent',
color: primaryColor, color: primaryColor,
zIndex: 2, zIndex: 2
fontFamily: fontSecondary,
fontSize: 14,
fontWeight: 500
}, },
lowerBound: { lowerBound: {
width: [['50%', '!important']],
left: '50%' left: '50%'
}, },
upperBound: { upperBound: {
width: [['50%', '!important']],
right: '50%' right: '50%'
}, },
selected: { selected: {

View file

@ -7,8 +7,11 @@ import {
FormControlLabel FormControlLabel
} from '@material-ui/core' } from '@material-ui/core'
import typographyStyles from '../../typography/styles'
import { secondaryColor } from '../../../styling/variables' import { secondaryColor } from '../../../styling/variables'
const { p } = typographyStyles
const GreenRadio = withStyles({ const GreenRadio = withStyles({
root: { root: {
color: secondaryColor, color: secondaryColor,
@ -19,13 +22,19 @@ const GreenRadio = withStyles({
checked: {} checked: {}
})(props => <MaterialRadio color='default' {...props} />) })(props => <MaterialRadio color='default' {...props} />)
const Label = withStyles({
label: {
extend: p
}
})(props => <FormControlLabel {...props} />)
const RadioGroup = ({ name, value, labels, ariaLabel, onChange, className, ...props }) => { const RadioGroup = ({ name, value, labels, ariaLabel, onChange, className, ...props }) => {
return ( return (
<> <>
{labels && ( {labels && (
<MaterialRadioGroup aria-label={ariaLabel} name={name} value={value} onChange={onChange} className={classnames(className)}> <MaterialRadioGroup aria-label={ariaLabel} name={name} value={value} onChange={onChange} className={classnames(className)}>
{labels.map((label, idx) => ( {labels.map((label, idx) => (
<FormControlLabel key={idx} value={idx} control={<GreenRadio />} label={label} /> <Label key={idx} value={idx} control={<GreenRadio />} label={label} />
))} ))}
</MaterialRadioGroup> </MaterialRadioGroup>
)} )}

View file

@ -40,7 +40,8 @@ function Select ({ label, items, ...props }) {
<button <button
{...getToggleButtonProps()} {...getToggleButtonProps()}
> >
{startCase(selectedItem)} <Arrowdown /> <span className={classes.selectedItem}>{startCase(selectedItem)}</span>
<Arrowdown />
</button> </button>
<ul {...getMenuProps()}> <ul {...getMenuProps()}>
{isOpen && {isOpen &&
@ -49,7 +50,7 @@ function Select ({ label, items, ...props }) {
key={`${item}${index}`} key={`${item}${index}`}
{...getItemProps({ item, index })} {...getItemProps({ item, index })}
> >
{startCase(item)} <span>{startCase(item)}</span>
</li> </li>
))} ))}
</ul> </ul>

View file

@ -1,30 +1,36 @@
import { zircon, comet, white } from '../../../styling/variables' import { subheaderColor, offColor, white } from '../../../styling/variables'
import typographyStyles from '../../typography/styles' import typographyStyles from '../../typography/styles'
const { select, regularLabel } = typographyStyles const { p, label1 } = typographyStyles
const WIDTH = 152 const WIDTH = 152
export default { export default {
selectedItem: {
width: WIDTH - 41,
display: 'block',
whiteSpace: 'nowrap',
overflow: 'hidden'
},
select: { select: {
width: WIDTH, width: WIDTH,
zIndex: 1000, zIndex: 1000,
'& label': { '& label': {
extend: regularLabel, extend: label1,
color: comet, color: offColor,
paddingLeft: 10 paddingLeft: 10
}, },
'& button': { '& button': {
extend: select, extend: p,
position: 'relative', position: 'relative',
border: 0, border: 0,
backgroundColor: zircon, backgroundColor: subheaderColor,
width: WIDTH, width: WIDTH,
padding: '6px 0 6px 12px', padding: [[6, 0, 6, 12]],
borderRadius: 20, borderRadius: 20,
lineHeight: '1.14', lineHeight: '1.14',
textAlign: 'left', textAlign: 'left',
color: comet, color: offColor,
cursor: 'pointer', cursor: 'pointer',
outline: '0 none' outline: '0 none'
}, },
@ -36,16 +42,23 @@ export default {
margin: 0, margin: 0,
borderTop: 0, borderTop: 0,
padding: 0, padding: 0,
borderRadius: '0 0 16px 16px', borderRadius: [[0, 0, 16, 16]],
backgroundColor: zircon, backgroundColor: subheaderColor,
outline: '0 none', outline: '0 none',
'& li': { '& li': {
extend: p,
listStyleType: 'none', listStyleType: 'none',
padding: '6px 0 6px 12px', padding: [[6, 12]],
cursor: 'pointer' cursor: 'pointer',
'& span': {
width: '100%',
display: 'block',
overflow: 'hidden',
whiteSpace: 'nowrap'
}
}, },
'& li:hover': { '& li:hover': {
backgroundColor: comet, backgroundColor: offColor,
color: white color: white
} }
}, },
@ -53,31 +66,31 @@ export default {
position: 'absolute', position: 'absolute',
top: 12, top: 12,
right: 14, right: 14,
fill: comet fill: offColor
} }
}, },
selectFiltered: { selectFiltered: {
'& button': { '& button': {
backgroundColor: comet, backgroundColor: offColor,
color: white color: white
}, },
'& ul': { '& ul': {
'& li': { '& li': {
backgroundColor: comet, backgroundColor: offColor,
color: white color: white
}, },
'& li:hover': { '& li:hover': {
backgroundColor: zircon, backgroundColor: subheaderColor,
color: comet color: offColor
} }
}, },
'& svg': { '& svg': {
fill: `${white} !important` fill: [[white], '!important']
} }
}, },
open: { open: {
'& button': { '& button': {
borderRadius: '16px 16px 0 0' borderRadius: [[16, 16, 0, 0]]
} }
} }
} }

View file

@ -119,16 +119,6 @@ export default {
fontWeight: 500, fontWeight: 500,
color: fontColor color: fontColor
}, },
label3: {
fontSize: fontSize5,
fontFamily: fontSecondary,
fontWeight: 700
},
select: {
fontSize: fontSize3,
fontFamily: fontSecondary,
fontWeight: 500
},
inline: { inline: {
display: 'inline' display: 'inline'
}, },

View file

@ -13,12 +13,12 @@ import Uptime from '../components/Uptime'
import LogsDowloaderPopover from '../components/LogsDownloaderPopover' import LogsDowloaderPopover from '../components/LogsDownloaderPopover'
import { ReactComponent as Download } from '../styling/icons/button/download/zodiac.svg' import { ReactComponent as Download } from '../styling/icons/button/download/zodiac.svg'
import { ReactComponent as DownloadActive } from '../styling/icons/button/download/white.svg' import { ReactComponent as DownloadActive } from '../styling/icons/button/download/white.svg'
import { comet } from '../styling/variables' import { offColor } from '../styling/variables'
import typographyStyles from '../components/typography/styles' import typographyStyles from '../components/typography/styles'
import logsStyles from './Logs.styles' import logsStyles from './Logs.styles'
const { regularLabel } = typographyStyles const { p } = typographyStyles
const { tableWrapper } = logsStyles const { tableWrapper } = logsStyles
const localStyles = { const localStyles = {
@ -28,8 +28,8 @@ const localStyles = {
marginLeft: 0 marginLeft: 0
}, },
serverVersion: { serverVersion: {
extend: regularLabel, extend: p,
color: comet, color: offColor,
margin: 'auto 0 auto 0' margin: 'auto 0 auto 0'
}, },
headerLine2: { headerLine2: {

View file

@ -35,6 +35,7 @@ const primaryColor = zodiac
const secondaryColor = spring const secondaryColor = spring
const secondaryColorDark = spring2 const secondaryColorDark = spring2
const secondaryColorDarker = spring4 const secondaryColorDarker = spring4
const secondaryColorLighter = spring3
const backgroundColor = ghost const backgroundColor = ghost
const subheaderColor = zircon const subheaderColor = zircon
@ -46,6 +47,7 @@ const offColor = comet
const offDarkColor = comet2 const offDarkColor = comet2
const placeholderColor = comet const placeholderColor = comet
const errorColor = tomato const errorColor = tomato
const offErrorColor = mistyRose
const inputBorderColor = primaryColor const inputBorderColor = primaryColor
// General // General
@ -121,6 +123,7 @@ export {
secondaryColor, secondaryColor,
secondaryColorDark, secondaryColorDark,
secondaryColorDarker, secondaryColorDarker,
secondaryColorLighter,
subheaderColor, subheaderColor,
subheaderDarkColor, subheaderDarkColor,
backgroundColor, backgroundColor,
@ -132,6 +135,8 @@ export {
disabledColor2, disabledColor2,
linkPrimaryColor, linkPrimaryColor,
linkSecondaryColor, linkSecondaryColor,
errorColor,
offErrorColor,
fontSize1, fontSize1,
fontSize2, fontSize2,