Storybook router issue fix (#3525)

Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
Leo Giovanettiandsean-brydon authored and GitHub committed 2022-07-25 22:02:33 +01:00
1 parent 160ccc3502
commit e21e622096
5 files changed
+108 -100

No files matched your search

+4
View File
@@ -1,3 +1,4 @@
import { RouterContext } from "next/dist/shared/lib/router-context";
import * as NextImage from "next/image";
import "../styles/globals.css";
@@ -17,4 +18,7 @@ export const parameters = {
date: /Date$/,
},
},
nextRouter: {
Provider: RouterContext.Provider,
},
};
+4 -2
View File
@@ -24,13 +24,15 @@
"@radix-ui/react-slider": "^0.1.1",
"@radix-ui/react-switch": "^0.1.1",
"@radix-ui/react-tooltip": "^0.1.0",
"next": "12.2.0",
"next": "^12.2.0",
"next-transpile-modules": "^9.0.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-feather": "^2.0.9",
"react-hot-toast": "^2.2.0",
"storybook-addon-next": "^1.6.7"
"storybook-addon-designs": "^6.3.1",
"storybook-addon-next": "^1.6.7",
"storybook-addon-next-router": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.18.6",
@@ -1,9 +1,11 @@
import { ComponentMeta } from "@storybook/react";
import { Breadcrumb, BreadcrumbItem } from "@calcom/ui/v2";
export default {
title: "Breadcrumbs",
component: Breadcrumb,
};
} as ComponentMeta<typeof Breadcrumb>;
export const Default = () => (
<Breadcrumb>
+23 -23
View File
@@ -2,7 +2,7 @@
import { ComponentMeta } from "@storybook/react";
import { Calendar, Clock, Grid, Link, RefreshCw, User, Users } from "react-feather";
import { VerticalTabs } from "@calcom/ui/v2";
import { VerticalTabs } from "@calcom/ui/v2/navigation/tabs";
export default {
title: "Vertical Tabs",
@@ -32,18 +32,18 @@ const VerticalTabsPropsDefault = [
},
];
// export const Default = () => (
// <div className="w-full p-4" style={{ backgroundColor: "#F9FAFB" }}>
// <VerticalTabs tabs={VerticalTabsPropsDefault}></VerticalTabs>
// </div>
// );
export const Default = () => (
<div className="w-full p-4" style={{ backgroundColor: "#F9FAFB" }}>
<VerticalTabs tabs={VerticalTabsPropsDefault} />
</div>
);
// Default.parameters = {
// nextRouter: {
// path: "/[page]",
// asPath: "/profile",
// },
// };
Default.parameters = {
nextRouter: {
path: "/[page]",
asPath: "/profile",
},
};
const VerticalTabsPropsInfo = [
{
@@ -72,14 +72,14 @@ const VerticalTabsPropsInfo = [
},
];
// export const Info = () => (
// <div className="w-full p-4" style={{ backgroundColor: "#F9FAFB" }}>
// <VerticalTabs tabs={VerticalTabsPropsInfo}></VerticalTabs>
// </div>
// );
// Info.parameters = {
// nextRouter: {
// path: "/[page]",
// asPath: "/events",
// },
// };
export const Info = () => (
<div className="w-full p-4" style={{ backgroundColor: "#F9FAFB" }}>
<VerticalTabs tabs={VerticalTabsPropsInfo} />
</div>
);
Info.parameters = {
nextRouter: {
path: "/[page]",
asPath: "/events",
},
};