Skip to content

Commit

Permalink
Created a storybook with EditorContent to try out the EditorContent o…
Browse files Browse the repository at this point in the history
…utput.
  • Loading branch information
deepakjosp committed Oct 21, 2024
1 parent e22fbed commit 3751d90
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
31 changes: 31 additions & 0 deletions stories/Walkthroughs/Output/EditorContentDemo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { useState } from "react";

import { Editor, EditorContent } from "src";

import { INITIAL_CONTENT, ADDONS, MENTIONS } from "./constants";

const EditorContentDemo = () => {
const [content, setContent] = useState(INITIAL_CONTENT);

return (
<div className="neeto-ui-flex neeto-ui-flex-col neeto-ui-gap-4">
<div
className="neeto-ui-border-gray-400 neeto-ui-rounded neeto-ui-border"
style={{ border: "1px solid rgb(var(--neeto-ui-gray-400))" }}
>
<EditorContent {...{ content }} className="neeto-ui-p-4" />
</div>
<div>
<h3>Editor</h3>
<Editor
addons={ADDONS}
initialValue={content}
mentions={MENTIONS}
onChange={setContent}
/>
</div>
</div>
);
};

export default EditorContentDemo;
27 changes: 27 additions & 0 deletions stories/Walkthroughs/Output/EditorContentDemo.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Meta } from "@storybook/addon-docs";
import {
EDITOR_PROP_TABLE_COLUMNS,
EDITOR_CONTENT_PROP_TABLE_ROWS,
} from "../../constants";
import Table from "../../components/Table";

import EditorContentDemo from "./EditorContentDemo";

<Meta
title="Walkthroughs/Output/EditorContent demo"
parameters={{
layout: "padded",
viewMode: "docs",
previewTabs: {
canvas: {
hidden: true,
},
},
}}
/>

# EditorContent demo

To update the preview content, make use of the editor below. The changes will be instantly updated in the preview.

<EditorContentDemo />
35 changes: 35 additions & 0 deletions stories/Walkthroughs/Output/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3751d90

Please sign in to comment.