Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
cdedreuille committed Jun 8, 2023
1 parent 97e1ac3 commit 69a984a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
52 changes: 27 additions & 25 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useCallback, useEffect, useState } from "react";
import { ThemeProvider, ensure, themes } from "@storybook/theming";
import { STORY_CHANGED } from "@storybook/core-events";
import { addons, type API } from "@storybook/manager-api";

import { GuidedTour } from "./features/GuidedTour/GuidedTour";
Expand Down Expand Up @@ -72,34 +71,37 @@ export default function App({ api }: { api: API }) {
}}
/>
)}
<WelcomeModal
onProceed={() => setStep("2:StorybookTour")}
isOpen={enabled && step === "1:Welcome"}
skipOnboarding={skipOnboarding}
/>
{enabled && (step === "2:StorybookTour" || step === "5:ConfigureYourProject") && (
<GuidedTour
{enabled && step === "1:Welcome" && (
<WelcomeModal
onProceed={() => setStep("2:StorybookTour")}
skipOnboarding={skipOnboarding}
/>
)}
{enabled &&
(step === "2:StorybookTour" || step === "5:ConfigureYourProject") && (
<GuidedTour
api={api}
isFinalStep={step === "5:ConfigureYourProject"}
onFirstTourDone={() => {
setStep("3:WriteYourStory");
}}
onLastTourDone={() => {
api.selectStory("configure-your-project--docs");
skipOnboarding();
}}
/>
)}
{enabled && step === "3:WriteYourStory" && (
<WriteStoriesModal
api={api}
isFinalStep={step === "5:ConfigureYourProject"}
onFirstTourDone={() => {
setStep("3:WriteYourStory");
}}
onLastTourDone={() => {
api.selectStory("configure-your-project--docs");
skipOnboarding();
addonsStore={addons}
onFinish={() => {
api.selectStory("example-button--warning");
setStep("4:VisitNewStory");
}}
skipOnboarding={skipOnboarding}
/>
)}
<WriteStoriesModal
api={api}
addonsStore={addons}
onFinish={() => {
api.selectStory("example-button--warning");
setStep("4:VisitNewStory");
}}
isOpen={enabled && step === "3:WriteYourStory"}
skipOnboarding={skipOnboarding}
/>
</ThemeProvider>
);
}
14 changes: 5 additions & 9 deletions src/features/WriteStoriesModal/WriteStoriesModal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
STORY_RENDERED,
} from "@storybook/core-events";

const getData = jest.fn()
const getData = jest.fn();

const meta: Meta<typeof WriteStoriesModal> = {
component: WriteStoriesModal,
Expand All @@ -33,7 +33,7 @@ const meta: Meta<typeof WriteStoriesModal> = {
storyIndexInvalidatedCb = cb;
}
},
off: () => { },
off: () => {},
}),
} as any,
},
Expand All @@ -43,10 +43,10 @@ const meta: Meta<typeof WriteStoriesModal> = {
// do not respond to the first call, this would only return the data correctly if the story already exists
// which is not the case in this story, it only makes sense in the real scenario
.mockReturnValueOnce(null)
.mockReturnValueOnce({ some: "data" })
.mockReturnValueOnce({ some: "data" });
return (
<div style={{ width: "1200px", height: "800px" }}>{storyFn()}</div>
)
);
},
],
};
Expand All @@ -57,11 +57,7 @@ type Story = StoryObj<typeof meta>;

let storyIndexInvalidatedCb: () => void;

export const Default: Story = {
args: {
isOpen: true,
},
};
export const Default: Story = {};

export const DefaultPlayed: Story = {
args: {
Expand Down

0 comments on commit 69a984a

Please sign in to comment.