Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat(richtext): fixes comments in Props to display in storybook
Browse files Browse the repository at this point in the history
Fix PR #93
  • Loading branch information
danielbollom committed Nov 19, 2019
1 parent 3e8c3a4 commit fa1e526
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 34 deletions.
25 changes: 20 additions & 5 deletions src/components/RichText/RichText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,30 @@ import 'tinymce/plugins/paste/plugin.min'
import 'tinymce/plugins/charmap/plugin.min'

interface Props {
// id of the rich text editor component
/**
* id of the rich text editor component
* @default ""
*/
id?: string
// Initial value of the rich text editor
/**
* Initial value of the rich text editor
* @default ""
*/
value?: string
// Defines whether the rich text editor should be enabled/disabled (default = false)
/**
* Defines whether the rich text editor should be enabled/disabled (default = false)
* @default ""
*/
disabled?: boolean
// Height of the rich text editor
/**
* Height of the rich text editor
* @default 500
*/
height?: number
// Method run on the editors onEditorChange event. Returns editor content as HTML.
/**
* Method run on the editors onEditorChange event. Returns editor content as HTML.
* @default null
*/
onChange?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void
}

Expand Down
5 changes: 1 addition & 4 deletions src/helpers/controlSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ interface KeyValuePair {
value: any
}

const sizes: KeyValuePair[] = [
{ key: 'small', value: 'sm' },
{ key: 'large', value: 'lg' },
]
const sizes: KeyValuePair[] = [{ key: 'small', value: 'sm' }, { key: 'large', value: 'lg' }]

export function getControlSize(size: string | undefined): 'sm' | 'lg' | undefined {
const controlSize = sizes.find((s) => s.key === size)
Expand Down
18 changes: 3 additions & 15 deletions stories/graphs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ storiesOf('Graphs', module)
{
backgroundColor: 'blue',
label: 'Months',
data: [
{ x: 'January', y: 12 },
{ x: 'February', y: 11 },
{ x: 'March', y: 10 },
],
data: [{ x: 'January', y: 12 }, { x: 'February', y: 11 }, { x: 'March', y: 10 }],
},
]}
xAxes={[{ label: 'Months', type: 'category' }]}
Expand All @@ -35,11 +31,7 @@ storiesOf('Graphs', module)
{
backgroundColor: 'blue',
label: 'Months',
data: [
{ x: 'January', y: 12 },
{ x: 'February', y: 11 },
{ x: 'March', y: 10 },
],
data: [{ x: 'January', y: 12 }, { x: 'February', y: 11 }, { x: 'March', y: 10 }],
},
]}
xAxes={[{ label: 'Months', type: 'category' }]}
Expand All @@ -54,11 +46,7 @@ storiesOf('Graphs', module)
borderColor: 'red',
backgroundColor: 'blue',
label: 'Months',
data: [
{ x: 'January', y: 12 },
{ x: 'February', y: 11 },
{ x: 'March', y: 10 },
],
data: [{ x: 'January', y: 12 }, { x: 'February', y: 11 }, { x: 'March', y: 10 }],
},
]}
xAxes={[{ label: 'Months', type: 'category' }]}
Expand Down
6 changes: 1 addition & 5 deletions test/bargraph.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ describe('BarGraph', () => {
{
backgroundColor: 'blue',
label: 'Months',
data: [
{ x: 'January', y: 12 },
{ x: 'February', y: 11 },
{ x: 'March', y: 10 },
],
data: [{ x: 'January', y: 12 }, { x: 'February', y: 11 }, { x: 'March', y: 10 }],
},
]}
xAxes={[{ label: 'Months', type: 'category' }]}
Expand Down
6 changes: 1 addition & 5 deletions test/linegraph.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ describe('LineGraph', () => {
borderColor: 'red',
backgroundColor: 'blue',
label: 'Months',
data: [
{ x: 'January', y: 12 },
{ x: 'February', y: 11 },
{ x: 'March', y: 10 },
],
data: [{ x: 'January', y: 12 }, { x: 'February', y: 11 }, { x: 'March', y: 10 }],
},
]}
xAxes={[{ label: 'Months', type: 'category' }]}
Expand Down

0 comments on commit fa1e526

Please sign in to comment.