Skip to content

Commit 5b95e0a

Browse files
committed
Fix storybook
1 parent 1b908ba commit 5b95e0a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/stories/Composer.stories.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@ const story: Meta<typeof ComposerWithNavigation> = {
2828

2929
const parser = new ExpensiMark();
3030

31+
const DEFAULT_VALUE = `Composer can do the following:
32+
33+
* It can contain MD e.g. *bold* _italic_
34+
* Supports Pasted Images via Ctrl+V`;
35+
3136
function Default(props: ComposerProps) {
3237
const StyleUtils = useStyleUtils();
3338
const [pastedFile, setPastedFile] = useState<FileObject | null>(null);
34-
const [comment, setComment] = useState(props.defaultValue);
39+
const [comment, setComment] = useState(DEFAULT_VALUE);
3540
const renderedHTML = parser.replace(comment ?? '');
36-
const [selection, setSelection] = useState<TextSelection>(() => ({start: props.defaultValue?.length ?? 0, end: props.defaultValue?.length ?? 0, positionX: 0, positionY: 0}));
41+
const [selection, setSelection] = useState<TextSelection>(() => ({start: DEFAULT_VALUE.length, end: DEFAULT_VALUE.length, positionX: 0, positionY: 0}));
3742

3843
return (
3944
<View>
@@ -79,10 +84,6 @@ Default.args = {
7984
autoFocus: true,
8085
placeholder: 'Compose Text Here',
8186
placeholderTextColor: defaultTheme.placeholderText,
82-
defaultValue: `Composer can do the following:
83-
84-
* It can contain MD e.g. *bold* _italic_
85-
* Supports Pasted Images via Ctrl+V`,
8687
isDisabled: false,
8788
maxLines: 16,
8889
};

0 commit comments

Comments
 (0)