Skip to content

Commit

Permalink
fix: twitter editor content area size
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Jun 20, 2019
1 parent f6078d0 commit e59cea6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion @remirror/editor-twitter/src/components/twitter.editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export class TwitterEditor extends PureComponent<TwitterEditorProps, State> {

public render() {
const { mention, emojiPickerActive } = this.state;
const { editorStyles, ...rest } = this.remirrorProps;
return (
<ThemeProvider theme={this.theme}>
<RemirrorManager
Expand Down Expand Up @@ -308,7 +309,7 @@ export class TwitterEditor extends PureComponent<TwitterEditorProps, State> {
set={this.props.emojiSet}
emojiData={this.props.emojiData}
/>
<ManagedRemirrorProvider {...this.remirrorProps}>
<ManagedRemirrorProvider editorStyles={[this.theme.editorStyles, editorStyles]} {...rest}>
<TwitterEditorComponent
mention={mention}
emojiPickerActive={emojiPickerActive}
Expand Down
8 changes: 7 additions & 1 deletion @remirror/editor-twitter/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DefaultStyled, { CreateStyled } from '@emotion/styled';
import { Cast } from '@remirror/core';
import { Cast, EDITOR_CLASS_SELECTOR } from '@remirror/core';

export const styled = Cast<CreateStyled<TwitterEditorTheme>>(DefaultStyled);
export type TwitterEditorTheme = typeof uiTwitterTheme;
Expand All @@ -19,4 +19,10 @@ export const uiTwitterTheme = {
size: '1em',
weight: '400',
},
editorStyles: {
[EDITOR_CLASS_SELECTOR]: {
width: '100%',
height: '100%',
},
},
};

0 comments on commit e59cea6

Please sign in to comment.