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

View File

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

View File

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