From 5faa4600f583a22c74f7e754a68a554d9e54185d Mon Sep 17 00:00:00 2001 From: John Lyon-Smith Date: Mon, 26 Feb 2018 16:38:18 -0800 Subject: [PATCH] Login screen looking good --- website/src/App.js | 6 +- website/src/Auth/Login.js | 95 +++++++++++++--------- website/src/Users/UserFormPlaceholder.js | 1 - website/src/Users/UserFormPlaceholder.scss | 7 -- website/src/Users/ValidatedEmailIcon.js | 10 +-- website/src/Users/ValidatedEmailIcon.scss | 3 - website/src/Validated/ValidatedButton.js | 11 ++- website/src/Validated/ValidatedCheckbox.js | 9 +- website/src/Validated/ValidatedInput.js | 21 +++-- website/src/ui/Box.js | 2 +- website/src/ui/Button.js | 8 +- website/src/ui/Button.style.js | 7 +- website/src/ui/Checkbox.js | 17 +++- website/src/ui/Checkbox.style.js | 8 +- website/src/ui/Input.js | 9 +- website/src/ui/Label.js | 33 -------- website/src/ui/Row.js | 7 +- website/src/ui/index.js | 1 - 18 files changed, 120 insertions(+), 135 deletions(-) delete mode 100644 website/src/Users/UserFormPlaceholder.scss delete mode 100644 website/src/Users/ValidatedEmailIcon.scss delete mode 100644 website/src/ui/Label.js diff --git a/website/src/App.js b/website/src/App.js index 85582d0..0017797 100644 --- a/website/src/App.js +++ b/website/src/App.js @@ -25,7 +25,8 @@ export class App extends React.Component { - + + @@ -40,9 +41,10 @@ export class App extends React.Component { + - {versionInfo.fullVersion} {versionInfo.copyright} + {'v' + versionInfo.version} {versionInfo.copyright} diff --git a/website/src/Auth/Login.js b/website/src/Auth/Login.js index e8621ab..857a791 100644 --- a/website/src/Auth/Login.js +++ b/website/src/Auth/Login.js @@ -4,8 +4,9 @@ import { regExpPattern } from 'regexp-pattern' import { api } from '../helpers' import { Validator, ValidatedInput, ValidatedCheckbox, ValidatedButton } from '../Validated' import { WaitDialog, MessageDialog } from '../Dialog' -import { Image, Link, Text, Column } from 'ui' +import { Image, Link, Text, Row, Column } from 'ui' import headerLogo from 'images/deighton.png' +import { versionInfo } from '../version' export class Login extends React.Component { static propTypes = { @@ -87,41 +88,61 @@ export class Login extends React.Component { } render() { - return null && ( -
-
- - - - - - - - - - - - Forgot your password? - - - - - - - - - - Please contact support@jamoki.com to request login credentials. - - - -
+ return ( + +   + +
+ + + + + + + + + + + + + + + + + + + + Forgot your password? + + + + + + + + + + + +
+ +
+
+
+ + +
+ Please contact {versionInfo.supportEmail} to request login credentials. +
+
+
+
+
+   @@ -129,7 +150,7 @@ export class Login extends React.Component { title={this.state.messageDialog ? this.state.messageDialog.title : ''} message={this.state.messageDialog ? this.state.messageDialog.message : ''} onDismiss={this.handleMessageDialogDismiss} /> -
+ ) } } diff --git a/website/src/Users/UserFormPlaceholder.js b/website/src/Users/UserFormPlaceholder.js index daaa5b4..fde8d19 100644 --- a/website/src/Users/UserFormPlaceholder.js +++ b/website/src/Users/UserFormPlaceholder.js @@ -1,5 +1,4 @@ import React from 'react' -import './UserFormPlaceholder.scss' export const UserFormPlaceholder = () => (
diff --git a/website/src/Users/UserFormPlaceholder.scss b/website/src/Users/UserFormPlaceholder.scss deleted file mode 100644 index ecc0ed2..0000000 --- a/website/src/Users/UserFormPlaceholder.scss +++ /dev/null @@ -1,7 +0,0 @@ -.user-form-placeholder { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; -} diff --git a/website/src/Users/ValidatedEmailIcon.js b/website/src/Users/ValidatedEmailIcon.js index 8dbd629..feff83f 100644 --- a/website/src/Users/ValidatedEmailIcon.js +++ b/website/src/Users/ValidatedEmailIcon.js @@ -1,7 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { Label, Button, Icon } from 'ui' -import './ValidatedEmailIcon.scss' +import { Text, Button, Icon } from 'ui' // This is a validated component with a value that cannot change itself and is specialized @@ -28,15 +27,14 @@ export class ValidatedEmailIcon extends React.Component { if (this.state.value) { return (
- +   +
) } else { return (
- +  
diff --git a/website/src/Users/ValidatedEmailIcon.scss b/website/src/Users/ValidatedEmailIcon.scss deleted file mode 100644 index 4fda86e..0000000 --- a/website/src/Users/ValidatedEmailIcon.scss +++ /dev/null @@ -1,3 +0,0 @@ -.mail-validated-icon { - padding-top: 4px; -} diff --git a/website/src/Validated/ValidatedButton.js b/website/src/Validated/ValidatedButton.js index 40279ce..3242a4f 100644 --- a/website/src/Validated/ValidatedButton.js +++ b/website/src/Validated/ValidatedButton.js @@ -10,10 +10,8 @@ export class ValidatedButton extends React.Component { size: PropTypes.string, content: PropTypes.string, validator: PropTypes.object.isRequired, - primary: PropTypes.bool, submit: PropTypes.bool, color: PropTypes.string, - floated: PropTypes.string, onClick: PropTypes.func } @@ -48,10 +46,11 @@ export class ValidatedButton extends React.Component { return (
-
diff --git a/website/src/Validated/ValidatedCheckbox.js b/website/src/Validated/ValidatedCheckbox.js index b7ba707..ba96ec5 100644 --- a/website/src/Validated/ValidatedCheckbox.js +++ b/website/src/Validated/ValidatedCheckbox.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { Checkbox, Label } from 'ui' +import { Checkbox } from 'ui' // This is an example of a validated component with a value that can change itself, that cannot ever be invalid. @@ -8,9 +8,7 @@ export class ValidatedCheckbox extends React.Component { static propTypes = { name: PropTypes.string.isRequired, label: PropTypes.string, - width: PropTypes.number, validator: PropTypes.object.isRequired, - className: PropTypes.string } constructor(props) { @@ -37,10 +35,7 @@ export class ValidatedCheckbox extends React.Component { render() { return ( - + ) } } diff --git a/website/src/Validated/ValidatedInput.js b/website/src/Validated/ValidatedInput.js index 0e5895e..d40b4b7 100644 --- a/website/src/Validated/ValidatedInput.js +++ b/website/src/Validated/ValidatedInput.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { Input, Label, Text } from 'ui' +import { Input, Text } from 'ui' // This is an example of a validated component with a value that changes itself @@ -9,7 +9,6 @@ export class ValidatedInput extends React.Component { name: PropTypes.string.isRequired, message: PropTypes.string, label: PropTypes.string, - width: PropTypes.number, validator: PropTypes.object.isRequired, password: PropTypes.bool, placeholder: PropTypes.string @@ -39,16 +38,16 @@ export class ValidatedInput extends React.Component { render() { return ( -
- +
+ {this.props.label}
- {this.props.message} + +
+ {this.props.message}
) } diff --git a/website/src/ui/Box.js b/website/src/ui/Box.js index 4a098c3..c73bbe7 100644 --- a/website/src/ui/Box.js +++ b/website/src/ui/Box.js @@ -4,7 +4,7 @@ import React, { Component } from 'react' class Box extends Component { static propTypes = { - borderTop: PropTypes.number, + borderTop: PropTypes.string, borderBottom: PropTypes.string, borderRight: PropTypes.string, borderLeft: PropTypes.string, diff --git a/website/src/ui/Button.js b/website/src/ui/Button.js index a98fc7b..f24b26e 100644 --- a/website/src/ui/Button.js +++ b/website/src/ui/Button.js @@ -5,13 +5,15 @@ import style from './Button.style' class Button extends Component { static propTypes = { - submit: PropTypes.string, - children: PropTypes.node + submit: PropTypes.bool, + children: PropTypes.node, + width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]) } render() { + const { children, submit, width } = this.props return ( - + ) } } diff --git a/website/src/ui/Button.style.js b/website/src/ui/Button.style.js index 18ba147..f247567 100644 --- a/website/src/ui/Button.style.js +++ b/website/src/ui/Button.style.js @@ -5,15 +5,14 @@ export default { borderRadius: '10px', fontFamily: fontInfo.family, color: '#FFFFFF', - fontSize: '20px', + fontSize: fontInfo.size['large'], background: colorInfo.buttonBackgroundHover, - padding: '10px 20px 10px 20px', - textDecoration: 'none', + verticalAlign: 'middle', + padding: '8px 15px 8px 15px', outline: 'none', ':hover': { background: colorInfo.buttonBackground, - textDecoration: 'none' } } } diff --git a/website/src/ui/Checkbox.js b/website/src/ui/Checkbox.js index c6055b7..4db2b76 100644 --- a/website/src/ui/Checkbox.js +++ b/website/src/ui/Checkbox.js @@ -3,10 +3,12 @@ import PropTypes from 'prop-types' import React, { Component } from 'react' import style from './Checkbox.style' import { reactAutoBind } from 'auto-bind2' +import { fontInfo } from './style' class Checkbox extends Component { static propTypes = { - value: PropTypes.bool + value: PropTypes.bool, + label: PropTypes.string, } constructor(props) { @@ -23,8 +25,17 @@ class Checkbox extends Component { render() { return ( -
-
+
+
+
+
+ {this.props.label}
) } diff --git a/website/src/ui/Checkbox.style.js b/website/src/ui/Checkbox.style.js index 6e6bc5a..8b1ca4e 100644 --- a/website/src/ui/Checkbox.style.js +++ b/website/src/ui/Checkbox.style.js @@ -2,13 +2,12 @@ import { colorInfo } from './style' export default { checkbox: { + display: 'inline-block', cursor: 'pointer', position: 'relative', backgroundColor: colorInfo.buttonBackground, - top: 0, - left: 0, height: 25, - width: 25 + width: 25, }, checkboxUnchecked: { @@ -20,7 +19,6 @@ export default { checkmark: { position: 'absolute', - display: 'block', content: '', left: 8, top: 4, @@ -34,5 +32,5 @@ export default { checkmarkUnchecked: { display: 'none' - } + }, } diff --git a/website/src/ui/Input.js b/website/src/ui/Input.js index 372ea9f..c11232f 100644 --- a/website/src/ui/Input.js +++ b/website/src/ui/Input.js @@ -6,12 +6,17 @@ import style from './Input.style' class Input extends Component { static propTypes = { password: PropTypes.bool, - children: PropTypes.node + children: PropTypes.node, + width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]) } render() { + let { children, width } = this.props + + width = width || '100%' + return ( - {this.props.children} + {children} ) } } diff --git a/website/src/ui/Label.js b/website/src/ui/Label.js deleted file mode 100644 index 096ffa1..0000000 --- a/website/src/ui/Label.js +++ /dev/null @@ -1,33 +0,0 @@ -import Radium from 'radium' -import PropTypes from 'prop-types' -import React, { Component } from 'react' -import { fontInfo } from './style' - -class Label extends Component { - static propTypes = { - size: PropTypes.string, - color: PropTypes.string, - margin: PropTypes.number, - children: PropTypes.node - } - - static defaultProps = { - size: 'medium', - color: 'normal', - margin: 0 - } - - render() { - return ( - - ) - } -} - -export default Radium(Label) diff --git a/website/src/ui/Row.js b/website/src/ui/Row.js index c9c369f..a5cca28 100644 --- a/website/src/ui/Row.js +++ b/website/src/ui/Row.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types' class Row extends Component { static propTypes = { children: PropTypes.node, - minWidth: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]).isRequired + minWidth: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]) } render() { @@ -21,15 +21,16 @@ Row.Item = Radium(class RowLayoutItem extends Component { static propTypes = { children: PropTypes.node, minWidth: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), + width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), grow: PropTypes.bool, } render() { - const { children, grow, minWidth } = this.props + const { children, grow, width, minWidth } = this.props const flexGrow = grow ? 1 : null return ( -
{children}
+
{children}
) } }) diff --git a/website/src/ui/index.js b/website/src/ui/index.js index 551fe71..d7fda85 100644 --- a/website/src/ui/index.js +++ b/website/src/ui/index.js @@ -5,7 +5,6 @@ export { default as Input } from './Input' export { default as Image } from './Image' export { default as Text } from './Text' export { default as Link } from './Link' -export { default as Label } from './Label' export { default as Icon } from './Icon' export { default as List } from './List' export { default as Dropdown } from './Dropdown'