diff --git a/src/core/Meganav/Meganav.stories.tsx b/src/core/Meganav/Meganav.stories.tsx index 2152cd029..31bf05b4b 100644 --- a/src/core/Meganav/Meganav.stories.tsx +++ b/src/core/Meganav/Meganav.stories.tsx @@ -1,6 +1,5 @@ import React, { useEffect } from "react"; import { http, HttpResponse } from "msw"; - import Meganav from "../Meganav"; import loadIcons from "../icons.js"; import logo from "../images/ably-logo.png"; @@ -26,7 +25,18 @@ export default { msw: { handlers: [ http.get("/api/me", () => { - return HttpResponse.json({}); + return HttpResponse.json({ + accountName: "Account Name", + signedIn: true, + account: { + links: { + dashboard: { + text: "Dashboard", + href: "/accounts/1", + }, + }, + }, + }); }), http.get("/api/blog", () => { return HttpResponse.json([ @@ -66,7 +76,7 @@ const Page = () => { const store = getRemoteDataStore(); - fetchSessionData(store, "/api/me"); + fetchSessionData(store, ""); fetchBlogPosts(store, "/api/blog"); }, []); @@ -84,3 +94,26 @@ const Page = () => { export const Default = { render: () => , }; + +const PageSignedIn = () => { + useEffect(() => { + loadIcons(); + const store = getRemoteDataStore(); + fetchSessionData(store, "/api/me"); + fetchBlogPosts(store, "/api/blog"); + }, []); + + return ( + + ); +}; + +export const SignedIn = { + render: () => , +}; diff --git a/src/core/MeganavItemsSignedIn.stories.tsx b/src/core/MeganavItemsSignedIn.stories.tsx deleted file mode 100644 index 66193b604..000000000 --- a/src/core/MeganavItemsSignedIn.stories.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; - -import MeganavItemsSignedIn from "./MeganavItemsSignedIn"; - -const meta = { - component: MeganavItemsSignedIn, -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = { - args: { - sessionState: { - signedIn: true, - accountName: "Free account", - preferredEmail: "free6218@ably.io", - account: { - links: { - dashboard: { - href: "https://ably.com/account", - }, - }, - }, - logOut: { - token: "", - href: "", - text: "", - }, - mySettings: { - text: "", - href: "", - }, - myAccessTokens: { - text: "", - href: "", - }, - }, - - theme: {}, - - absUrl: () => "https://ably.com/search?", - }, -}; diff --git a/src/core/MeganavItemsSignedIn.tsx b/src/core/MeganavItemsSignedIn.tsx index be7f6af35..f60a7e0cc 100644 --- a/src/core/MeganavItemsSignedIn.tsx +++ b/src/core/MeganavItemsSignedIn.tsx @@ -23,7 +23,7 @@ const MeganavItemsSignedIn = ({ return (
  • - + {accountName}