remove docs panel addon
This commit is contained in:
parent
bb99b6dced
commit
02c1beb19b
4 changed files with 0 additions and 49 deletions
|
|
@ -1,32 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { useParameter, useStorybookState } from '@storybook/manager-api';
|
|
||||||
import { AddonPanel } from '@storybook/components';
|
|
||||||
import { PARAM_KEY } from './constants.ts';
|
|
||||||
import * as Blocks from '@storybook/blocks';
|
|
||||||
|
|
||||||
interface PanelProps {
|
|
||||||
active: boolean | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Tab: React.FC<PanelProps> = (props) => {
|
|
||||||
const { storyId } = useStorybookState(); // Get the current story ID
|
|
||||||
const markdownContent = useParameter<Record<string, string>>(PARAM_KEY, {});
|
|
||||||
|
|
||||||
// Fetch Markdown content specific to the current story
|
|
||||||
const content =
|
|
||||||
markdownContent[storyId] || 'No documentation provided for this story.';
|
|
||||||
|
|
||||||
console.log('PROPS', props);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<AddonPanel active={!!props.active}>
|
|
||||||
<Blocks.Wrapper>
|
|
||||||
<div style={{ padding: '15px' }} className="sbdocs sbdocs-content">
|
|
||||||
<Blocks.Markdown>{content}</Blocks.Markdown>
|
|
||||||
</div>
|
|
||||||
</Blocks.Wrapper>
|
|
||||||
</AddonPanel>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Tab;
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export const ADDON_ID = 'storybook/canvas-docs';
|
|
||||||
export const PANEL_ID = `${ADDON_ID}/panel`;
|
|
||||||
export const PARAM_KEY = 'canvasDocs';
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { addons, types } from '@storybook/manager-api';
|
|
||||||
import { ADDON_ID, PANEL_ID } from './constants';
|
|
||||||
import Tab from './Tab';
|
|
||||||
|
|
||||||
addons.register(ADDON_ID, () => {
|
|
||||||
addons.add(PANEL_ID, {
|
|
||||||
type: types.PANEL,
|
|
||||||
title: 'Docs',
|
|
||||||
match: ({ viewMode }) => viewMode === 'story',
|
|
||||||
render: (props) => <Tab {...props} />,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { addons } from '@storybook/manager-api';
|
import { addons } from '@storybook/manager-api';
|
||||||
import theme from './Theme';
|
import theme from './Theme';
|
||||||
// import './add-ons/canvas-docs';
|
|
||||||
|
|
||||||
addons.setConfig({
|
addons.setConfig({
|
||||||
isFullscreen: false,
|
isFullscreen: false,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue