Added back button on preferences.

This commit is contained in:
Sean Li 2015-02-17 09:33:11 -08:00
parent 9f782d43a1
commit ba9406bf06
3 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,7 @@
var React = require('react/addons'); var React = require('react/addons');
var assign = require('object-assign'); var assign = require('object-assign');
var ipc = require('ipc'); var ipc = require('ipc');
var Router = require('react-router');
// TODO: move this somewhere else // TODO: move this somewhere else
if (localStorage.getItem('options')) { if (localStorage.getItem('options')) {
@ -8,6 +9,7 @@ if (localStorage.getItem('options')) {
} }
var Preferences = React.createClass({ var Preferences = React.createClass({
mixins: [Router.Navigation],
getInitialState: function () { getInitialState: function () {
var data = JSON.parse(localStorage.getItem('options')); var data = JSON.parse(localStorage.getItem('options'));
return assign({ return assign({
@ -31,11 +33,14 @@ var Preferences = React.createClass({
componentDidUpdate: function () { componentDidUpdate: function () {
this.saveState(); this.saveState();
}, },
handleGoBackClick: function () {
this.goBack();
},
render: function () { render: function () {
console.log('render');
return ( return (
<div className="preferences"> <div className="preferences">
<div className="preferences-content"> <div className="preferences-content">
<a href="#" onClick={this.handleGoBackClick}>Go Back</a>
<div className="title">VM Settings</div> <div className="title">VM Settings</div>
<div className="option"> <div className="option">
<div className="option-name"> <div className="option-name">

View File

@ -9,7 +9,7 @@
.preferences-content { .preferences-content {
flex: 1 auto; flex: 1 auto;
margin-top: 20px; margin-top: 45px;
padding: 50px; padding: 50px;
max-width: 640px; max-width: 640px;
display: flex; display: flex;

View File

@ -21,6 +21,13 @@ h4 {
font-weight: 500; font-weight: 500;
} }
a {
transition: all 0.25s;
&:hover {
text-decoration: none;
}
}
.popover-content { .popover-content {
color: @gray-normal; color: @gray-normal;
font-size: 13px; font-size: 13px;