Tweaked editor actions

This commit is contained in:
Jori Lallo
2016-08-02 13:12:15 +03:00
parent 9de77e1524
commit 813fddbfa3
5 changed files with 16 additions and 11 deletions

View File

@@ -5,5 +5,8 @@
cursor: pointer;
min-height: 43px;
padding: 0 0.5rem;
color: #0C77F8;
}
a {
color: #171B35;
}
}

View File

@@ -0,0 +1,32 @@
import React from 'react';
import { observer } from 'mobx-react';
@observer
class SaveAction extends React.Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool,
}
onClick = (event) => {
if (this.props.disabled) return;
event.preventDefault();
this.props.onClick();
}
render() {
return (
<div>
<a
href
onClick={ this.onClick }
style={ { opacity: this.props.disabled ? 0.5 : 1 } }
title="Save changes (Cmd+Enter)"
>Save</a>
</div>
);
}
}
export default SaveAction;

View File

@@ -0,0 +1,2 @@
import SaveAction from './SaveAction';
export default SaveAction;

View File

@@ -1,10 +1,12 @@
import Layout from './Layout';
import Title from './components/Title';
import HeaderAction from './components/HeaderAction';
import SaveAction from './components/SaveAction';
export default Layout;
export {
Title,
HeaderAction,
SaveAction,
};