Skip to content

Commit

Permalink
feat: add data for VersionControl in Storybook DocPage
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Tyan committed Feb 20, 2025
1 parent 00f33d1 commit c8afea6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions demo/src/Components/DocPage/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ const useDirection = (lang: string) => {
}, [lang, dir]);
};

const useVersions = () => {
const versions = ['v4.23.1', 'v4.23.0', 'v4.22.0'];
const version = versions[0];
const onChangeVersion = () => {};

return {
version,
versions,
onChangeVersion,
};
};

const useLangs = () => {
const langs = ['ru', 'en', 'cs', 'he'];
const [lang, onChangeLang] = useState(DEFAULT_SETTINGS.lang);
Expand Down Expand Up @@ -216,6 +228,7 @@ const DocPageDemo = (
const vcsType = args['VCS'];
const router = {pathname: '/docs/overview/security-and-compliance/'};

const versions = useVersions();
const settings = useSettings();
const langs = useLangs();
const fullscreen = useFullscreen();
Expand Down Expand Up @@ -251,6 +264,7 @@ const DocPageDemo = (
Object.assign(
props,
...[
args['Versions'] && versions,
args['Search'] && search,
args['Settings'] && settings,
args['Langs'] && langs,
Expand Down Expand Up @@ -289,6 +303,9 @@ export default {
title: 'Pages/Document',
component: DocPageDemo,
argTypes: {
Versions: {
control: 'boolean',
},
Settings: {
control: 'boolean',
},
Expand Down Expand Up @@ -332,6 +349,7 @@ export default {

export const Document = {
args: {
Versions: true,
Settings: true,
Langs: true,
Fullscreen: true,
Expand Down

0 comments on commit c8afea6

Please sign in to comment.