Improve log in look and feel.

master
Tom Hacohen 7 years ago
parent 622805a5b6
commit 516bdd2622

@ -33,7 +33,7 @@ const muiTheme = getMuiTheme({
} }
}); });
function getPalette(part: string): string { export function getPalette(part: string): string {
const theme = muiTheme; const theme = muiTheme;
if ((theme.palette === undefined) || (theme.palette[part] === undefined)) { if ((theme.palette === undefined) || (theme.palette[part] === undefined)) {
return ''; return '';

@ -4,4 +4,6 @@ export const faq = homePage + 'faq/';
export const sourceCode = 'https://github.com/etesync/etesync-web'; export const sourceCode = 'https://github.com/etesync/etesync-web';
export const reportIssue = sourceCode + '/issues'; export const reportIssue = sourceCode + '/issues';
export const forgotPassword = 'https://www.etesync.com/accounts/password/reset/';
export const serviceApiBase = 'https://api.etesync.com/'; export const serviceApiBase = 'https://api.etesync.com/';

@ -1,5 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import { Switch, Route, Redirect } from 'react-router'; import { Switch, Route, Redirect } from 'react-router';
import Paper from 'material-ui/Paper';
import RaisedButton from 'material-ui/RaisedButton'; import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField'; import TextField from 'material-ui/TextField';
import Toggle from 'material-ui/Toggle'; import Toggle from 'material-ui/Toggle';
@ -9,7 +10,7 @@ import { JournalView } from './JournalView';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
import { routeResolver } from './App'; import { routeResolver, getPalette } from './App';
import * as C from './Constants'; import * as C from './Constants';
@ -118,36 +119,66 @@ export class EteSyncContext extends React.Component {
); );
} }
const styles = {
holder: {
margin: 'auto',
maxWidth: 400,
padding: 20,
},
paper: {
padding: 20,
},
form: {
},
forgotPassword: {
color: getPalette('accent1Color'),
paddingTop: 20,
},
advancedSettings: {
marginTop: 20,
},
submit: {
marginTop: 40,
textAlign: 'right',
},
};
return ( return (
<div> <div style={styles.holder}>
<Paper zDepth={2} style={styles.paper}>
{(this.state.error !== undefined) && (<div>Error! {this.state.error.message}</div>)} {(this.state.error !== undefined) && (<div>Error! {this.state.error.message}</div>)}
<form onSubmit={this.generateEncryption}> <h2>Please Log In</h2>
<form style={styles.form} onSubmit={this.generateEncryption}>
<TextField <TextField
type="text" type="text"
floatingLabelText="Username" floatingLabelText="Email"
ref={(input) => this.username = input as TextField} ref={(input) => this.username = input as TextField}
/> />
<br />
<TextField <TextField
type="password" type="password"
floatingLabelText="Password" floatingLabelText="Password"
ref={(input) => this.password = input as TextField} ref={(input) => this.password = input as TextField}
/> />
<br /> <div style={styles.forgotPassword}>
<a href={C.forgotPassword}>Forgot password?</a>
</div>
<TextField <TextField
type="password" type="password"
floatingLabelText="Encryption Password" floatingLabelText="Encryption Password"
ref={(input) => this.encryptionPassword = input as TextField} ref={(input) => this.encryptionPassword = input as TextField}
/> />
<br />
<Toggle <Toggle
label="Advanced settings" label="Advanced settings"
style={styles.advancedSettings}
toggled={this.state.showAdvanced} toggled={this.state.showAdvanced}
onToggle={this.toggleAdvancedSettings} onToggle={this.toggleAdvancedSettings}
/> />
{advancedSettings} {advancedSettings}
<div style={styles.submit}>
<RaisedButton type="submit" label="Log In" secondary={true} /> <RaisedButton type="submit" label="Log In" secondary={true} />
</div>
</form> </form>
</Paper>
</div> </div>
); );
} else if ((this.state.context === undefined) || } else if ((this.state.context === undefined) ||

Loading…
Cancel
Save