Additional shrinkage

This commit is contained in:
John Lyon-Smith
2018-03-07 11:23:34 -08:00
parent 9adca547f7
commit b1c72040c9
10 changed files with 57 additions and 43 deletions

View File

@@ -13,7 +13,7 @@ export class Home extends Component {
this.props.onChangeTitle('Home') this.props.onChangeTitle('Home')
} }
componentDidUnmount() { componentWillUnmount() {
this.props.onChangeTitle('') this.props.onChangeTitle('')
} }

View File

@@ -37,7 +37,7 @@ export class MessageModal extends React.Component {
<form onSubmit={this.onSubmit} id='messageModal'> <form onSubmit={this.onSubmit} id='messageModal'>
<Row> <Row>
<Row.Item> <Row.Item>
<Icon name={icon} size={sizeInfo.messageModalIcon} /> <Icon name={icon} size={sizeInfo.modalMessageIcon} />
</Row.Item> </Row.Item>
<Row.Item grow> <Row.Item grow>
<Column height='100%'> <Column height='100%'>

View File

@@ -35,7 +35,7 @@ export class YesNoMessageModal extends React.Component {
<form onSubmit={this.onSubmit} id='messageModal'> <form onSubmit={this.onSubmit} id='messageModal'>
<Row> <Row>
<Row.Item> <Row.Item>
<Icon name='help' size={sizeInfo.messageModalIcon} /> <Icon name='help' size={sizeInfo.modalMessageIcon} />
</Row.Item> </Row.Item>
<Row.Item grow> <Row.Item grow>
<Column height='100%'> <Column height='100%'>

View File

@@ -49,7 +49,7 @@ class Button extends Component {
return ( return (
<input name={name} type={!visible ? 'hidden' : submit ? 'submit' : 'button'} <input name={name} type={!visible ? 'hidden' : submit ? 'submit' : 'button'}
disabled={disabled} form={submit} disabled={disabled} form={submit}
style={[Button.style.button, { width, minWidth: sizeInfo.minButtonWidth }]} style={[Button.style.button, { width, minWidth: sizeInfo.buttonMinWidth }]}
onClick={onClick} value={text} /> onClick={onClick} value={text} />
) )
} }

View File

@@ -12,7 +12,6 @@ class HeaderButton extends Component {
} }
static style = { static style = {
button: {
background: colorInfo.headerButtonBackground, background: colorInfo.headerButtonBackground,
verticalAlign: 'middle', verticalAlign: 'middle',
borderWidth: 0, borderWidth: 0,
@@ -25,7 +24,6 @@ class HeaderButton extends Component {
background: colorInfo.headerButtonBackgroundActive, background: colorInfo.headerButtonBackgroundActive,
} }
} }
}
render() { render() {
const size = sizeInfo.headerHeight - sizeInfo.headerBorderWidth const size = sizeInfo.headerHeight - sizeInfo.headerBorderWidth
@@ -33,13 +31,13 @@ class HeaderButton extends Component {
let content = null let content = null
if (image) { if (image) {
content = (<Image source={image} width={size} height={size} />) content = (<Image source={image} width={size} height={size} margin={sizeInfo.headerButtonMargin} />)
} else if (icon) { } else if (icon) {
content = (<Icon name={icon} size={size} />) content = (<Icon name={icon} size={size} margin={sizeInfo.headerButtonMargin} />)
} }
return ( return (
<button type='button' style={[{ height: size, width: size }, HeaderButton.style.button]} onClick={onClick}> <button type='button' style={[{ height: size, width: size }, HeaderButton.style]} onClick={onClick}>
{content} {content}
</button> </button>
) )

View File

@@ -10,16 +10,16 @@ class HeaderText extends Component {
static style = { static style = {
position: 'relative', position: 'relative',
top: 3, top: sizeInfo.headerTextOffset,
display: 'inline-block', display: 'inline-block',
fontSize: fontInfo.size.huge, fontSize: fontInfo.size.header,
fontFamily: fontInfo.family, fontFamily: fontInfo.family,
color: fontInfo.color.normal, color: fontInfo.color.normal,
textAlign: 'left', textAlign: 'left',
background: 'transparent', background: 'transparent',
verticalAlign: 'middle', verticalAlign: 'middle',
borderWidth: 0, borderWidth: 0,
paddingLeft: 10, paddingLeft: sizeInfo.headerPaddingLeft,
} }
render() { render() {

View File

@@ -8,11 +8,12 @@ class Image extends Component {
source: PropTypes.string, source: PropTypes.string,
width: PropTypes.number, width: PropTypes.number,
height: PropTypes.number, height: PropTypes.number,
margin: PropTypes.number,
} }
render() { render() {
let { source, width, height } = this.props let { source, width, height } = this.props
const margin = sizeInfo.imageDefaultMargin const margin = this.props.margin || sizeInfo.imageDefaultMargin
width = width ? (width - margin * 2) : null width = width ? (width - margin * 2) : null
height = height ? (height - margin * 2) : null height = height ? (height - margin * 2) : null

View File

@@ -45,7 +45,7 @@ class PanelButton extends Component {
<Icon name={icon} size={sizeInfo.panelButtonIcon} margin={sizeInfo.panelButtonIconMargin} /> <Icon name={icon} size={sizeInfo.panelButtonIcon} margin={sizeInfo.panelButtonIconMargin} />
<span style={{ <span style={{
position: 'absolute', position: 'absolute',
top: sizeInfo.panelTextOffset, top: sizeInfo.panelButtonTextOffset,
left: 0, left: 0,
display: 'block', display: 'block',
fontSize: fontInfo.size.huge, fontSize: fontInfo.size.huge,

View File

@@ -7,7 +7,7 @@ class Text extends Component {
static propTypes = { static propTypes = {
size: PropTypes.oneOf(['small', 'medium', 'large', 'huge']), size: PropTypes.oneOf(['small', 'medium', 'large', 'huge']),
color: PropTypes.oneOf(['normal', 'inverse', 'alert', 'dimmed']), color: PropTypes.oneOf(['normal', 'inverse', 'alert', 'dimmed']),
margin: PropTypes.number, margin: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
children: PropTypes.node, children: PropTypes.node,
width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
hidden: PropTypes.bool, hidden: PropTypes.bool,

View File

@@ -41,41 +41,54 @@ Object.assign(colorInfo, {
}) })
const sizeInfo = { const sizeInfo = {
headerHeight: 60,
imageDefaultMargin: 5, imageDefaultMargin: 5,
iconDefaultMargin: 10, iconDefaultMargin: 10,
headerHeight: 40,
headerBorderWidth: 1, headerBorderWidth: 1,
listBorderWidth: 1, headerPaddingLeft: 10,
headerTextOffset: 2,
headerButtonMargin: 8,
footerTextMargin: '5px 0px 5px 10px',
buttonHeight: 40, buttonHeight: 40,
buttonPadding: '0 15px 0 15px', buttonPadding: '0 15px 0 15px',
minButtonWidth: 100,
checkboxSize: 25, checkboxSize: 25,
checkmarkBorder: '0 3px 3px 0', checkmarkBorder: '0 3px 3px 0',
panelButton: 200, panelButton: 200,
panelButtonIcon: 170, panelButtonIcon: 170,
panelButtonIconMargin: 0, panelButtonIconMargin: 0,
panelTextOffset: 120,
formBoxRadius: 5,
listTopBottomGap: 10,
modalWidth: 450,
modalShadowWidth: 25,
inputPadding: 5,
inputBorderRadius: 5,
listIconMargin: '5px 10px 5px 10px',
loaderSize: 20,
loaderSpacing: 5,
panelButtonBorderRadius: 25, panelButtonBorderRadius: 25,
panelButtonBorderWidth: 2, panelButtonBorderWidth: 2,
messageModalIcon: 150, panelButtonTextOffset: 125,
panelButtonSpacing: 30,
formBoxRadius: 5,
formColumnSpacing: 20, formColumnSpacing: 20,
formRowSpacing: 20, formRowSpacing: 20,
loginLogoWidth: 250,
footerTextMargin: 10,
panelButtonSpacing: 30,
formBoundIcon: 30, formBoundIcon: 30,
formBoundIconMargin: 0, formBoundIconMargin: 0,
listIcon: 25,
formButtonLarge: 225, formButtonLarge: 225,
listBorderWidth: 1,
listTopBottomGap: 10,
listIcon: 25,
listIconMargin: '5px 10px 5px 10px',
modalWidth: 450,
modalShadowWidth: 25,
modalMessageIcon: 150,
inputPadding: 5,
inputBorderRadius: 5,
loaderSize: 20,
loaderSpacing: 5,
loginLogoWidth: 250,
} }
const fontInfo = { const fontInfo = {
@@ -85,6 +98,8 @@ const fontInfo = {
medium: '12pt', medium: '12pt',
large: '14pt', large: '14pt',
huge: '26pt', huge: '26pt',
header: '18pt',
footer: '8pt',
}, },
color: { color: {
'normal': colorInfo.text, 'normal': colorInfo.text,