Tweaked editor actions
This commit is contained in:
@@ -5,5 +5,8 @@
|
||||
cursor: pointer;
|
||||
min-height: 43px;
|
||||
padding: 0 0.5rem;
|
||||
color: #0C77F8;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #171B35;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -0,0 +1,2 @@
|
||||
import SaveAction from './SaveAction';
|
||||
export default SaveAction;
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user