Skip to content

Commit 2b23216

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

8 files changed

+4875
-4876
lines changed

lib/Timeframe.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Timeframe.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/all.js

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/all.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/registration.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/registration.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+4,844-4,848
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ui/Note.js

+8-5
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)