Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hamed-farag/storybook-addon-discussion
https://github.com/hamed-farag/storybook-addon-discussion
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hamed-farag/storybook-addon-discussion
- Owner: hamed-farag
- License: mit
- Created: 2023-10-06T07:45:50.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-22T12:40:34.000Z (12 months ago)
- Last Synced: 2024-10-11T02:41:22.683Z (about 1 month ago)
- Language: TypeScript
- Size: 1.9 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Storybook Addon Storybook Discussion
Leave comments for components and MDX documents based on [addon-kit](https://github.com/storybookjs/addon-kit), comments are saved on [supabase](https://supabase.com/) database.### Usage
#### Installation
```
npm install -D storybook-addon-discussion
```#### Configuration
```ts
// .storybook/main.tsconst config: StorybookConfig = {
...
addons: [
...
"storybook-addon-discussion"
],
...
};
export default config;
``````ts
// .storybook/preview.tsimport type { Preview } from "@storybook/react";
const preview: Preview = {
parameters: {
...
discussion: {
supabase: {
url: "SUPABASE_PROJECT_URL", // example: https://YOUR_PROJECT_UNIQUE_ID.supabase.co
secret: "PROJECT_API_PUBLIC_KEY",
},
},
},
};export default preview;
``````sql
-- Create Query for comments table (comments_v1)
-- Execute this query on Supabase SQL Editorcreate table
comments_v1 (
id bigint generated by default as identity primary key,
author varchar(50) not null,
comment text not null,
storyId varchar(150) not null,
createdAt timestamp not null
);
```