add mobile and public shell stories

This commit is contained in:
Kaitlyn 2024-09-12 11:07:28 -04:00
Родитель 7ecf853039
Коммит 6751f8924b
2 изменённых файлов: 67 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,45 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { Session } from "next-auth";
import { SerializedSubscriber } from "../../../../next-auth";
import type { Meta, StoryObj } from "@storybook/react";
import { MobileShell } from "../MobileShell";
function createUser(): Session["user"] {
return {
email: "example@example.com",
fxa: {
locale: "us",
twoFactorAuthentication: false,
metricsEnabled: false,
avatar: "https://profile.stage.mozaws.net/v1/avatar/e",
avatarDefault: true,
subscriptions: ["monitor"],
},
subscriber: {
id: 42,
} as SerializedSubscriber,
};
}
const mockedSession = {
expires: new Date().toISOString(),
user: createUser(),
};
const meta: Meta<typeof MobileShell> = {
title: "Layout/Mobile Shell",
component: MobileShell,
};
export default meta;
type Story = StoryObj<typeof MobileShell>;
export const MobileShellStory: Story = {
args: {
countryCode: "us",
session: mockedSession,
},
};

Просмотреть файл

@ -0,0 +1,22 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import type { Meta, StoryObj } from "@storybook/react";
import { PublicShell } from "./PublicShell";
import { getL10n } from "../../../functions/l10n/storybookAndJest";
const meta: Meta<typeof PublicShell> = {
title: "Layout/Public Shell",
component: PublicShell,
};
export default meta;
type Story = StoryObj<typeof PublicShell>;
export const PublicShellStory: Story = {
args: {
countryCode: "us",
l10n: getL10n("en"),
},
};