Skip to content

Commit 2b23216

Browse files
Switch RichTextEditor with InputField textarea on Notes (#567)
1 parent 2c7d64d commit 2b23216

File tree

8 files changed

+4875
-4876
lines changed

8 files changed

+4875
-4876
lines changed

lib/Timeframe.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Timeframe.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/all.js

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/all.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/registration.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/registration.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 4844 additions & 4848 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ui/Note.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// @flow
2+
/* globals SyntheticInputEvent, HTMLInputElement */
23

34
import React, { PureComponent } from 'react'
45
import differenceInHours from 'date-fns/difference_in_hours'
@@ -8,6 +9,7 @@ import FileLinks from './FileLinks'
89
import PencilButton from './PencilButton'
910
import InlineEditor from './InlineEditor'
1011
import RichTextEditor from './RichTextEditor'
12+
import InputField from '../forms/InputField'
1113

1214
import typo from '../../styles/typo'
1315
import theme from '../../styles/theme'
@@ -174,7 +176,8 @@ class Note extends PureComponent<Props, State> {
174176
)
175177
}
176178

177-
handleEditorValueChange = (onValueChange: (value: any) => mixed) => ({ markdown: value }: { markdown: string }) => {
179+
handleEditorValueChange = (onValueChange: (value: any) => mixed) => (event: SyntheticInputEvent<HTMLInputElement>) => {
180+
const { value } = event.currentTarget
178181
this.setState({
179182
newValueIsValid: !!value.trim(),
180183
newValue: value
@@ -187,10 +190,10 @@ class Note extends PureComponent<Props, State> {
187190
const { newValue = '' } = this.state
188191

189192
return (
190-
<RichTextEditor
191-
initialValue={newValue}
192-
handleChange={this.handleEditorValueChange(onValueChange)}
193-
characterLimit={5000}
193+
<InputField
194+
value={newValue}
195+
onChange={this.handleEditorValueChange(onValueChange)}
196+
type='textarea'
194197
/>
195198
)
196199
}

0 commit comments

Comments
 (0)