Skip to content

Commit

Permalink
Update Composer.stories.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
QichenZhu authored Feb 1, 2025
1 parent 460b76e commit f288ffb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/stories/Composer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ const story: Meta<typeof ComposerWithNavigation> = {

const parser = new ExpensiMark();

const DEFAULT_VALUE = `Composer can do the following:
* It can contain MD e.g. *bold* _italic_
* Supports Pasted Images via Ctrl+V`;

function Default(props: ComposerProps) {
const StyleUtils = useStyleUtils();
const [pastedFile, setPastedFile] = useState<FileObject | null>(null);
const [comment, setComment] = useState(props.defaultValue);
const [comment, setComment] = useState(DEFAULT_VALUE);
const renderedHTML = parser.replace(comment ?? '');
const [selection, setSelection] = useState<TextSelection>(() => ({start: props.defaultValue?.length ?? 0, end: props.defaultValue?.length ?? 0, positionX: 0, positionY: 0}));
const [selection, setSelection] = useState<TextSelection>(() => ({start: DEFAULT_VALUE.length, end: DEFAULT_VALUE.length, positionX: 0, positionY: 0}));

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

0 comments on commit f288ffb

Please sign in to comment.