Fixes #137 - vertical alignment

This commit is contained in:
Tom Moor
2017-07-13 23:51:03 -07:00
parent 0136c0ddcf
commit eb3b597272
2 changed files with 32 additions and 26 deletions

View File

@ -154,32 +154,34 @@ type Props = {
onDrop={this.handleDrop}
onDragOver={this.cancelEvent}
onDragEnter={this.cancelEvent}
align="flex-start"
justify="center"
auto
column
align="center"
>
<HeaderContainer
onClick={this.focusAtStart}
readOnly={this.props.readOnly}
>
{this.props.heading}
</HeaderContainer>
<Toolbar state={this.state.state} onChange={this.onChange} />
<Editor
key={this.props.starred}
ref={ref => (this.editor = ref)}
placeholder="Start with a title..."
className={cx(styles.editor, { readOnly: this.props.readOnly })}
schema={this.schema}
plugins={this.plugins}
state={this.state.state}
onChange={this.onChange}
onDocumentChange={this.onDocumentChange}
onSave={this.props.onSave}
readOnly={this.props.readOnly}
/>
{!this.props.readOnly &&
<ClickablePadding onClick={this.focusAtEnd} grow />}
<MaxWidth column auto>
<HeaderContainer
onClick={this.focusAtStart}
readOnly={this.props.readOnly}
>
{this.props.heading}
</HeaderContainer>
<Toolbar state={this.state.state} onChange={this.onChange} />
<Editor
key={this.props.starred}
ref={ref => (this.editor = ref)}
placeholder="Start with a title..."
className={cx(styles.editor, { readOnly: this.props.readOnly })}
schema={this.schema}
plugins={this.plugins}
state={this.state.state}
onChange={this.onChange}
onDocumentChange={this.onDocumentChange}
onSave={this.props.onSave}
readOnly={this.props.readOnly}
/>
{!this.props.readOnly &&
<ClickablePadding onClick={this.focusAtEnd} grow />}
</MaxWidth>
</Flex>
);
};
@ -189,6 +191,11 @@ MarkdownEditor.childContextTypes = {
starred: PropTypes.bool,
};
const MaxWidth = styled(Flex)`
max-width: 50em;
height: 100%;
`;
const HeaderContainer = styled(Flex).attrs({
align: 'flex-end',
})`