Skip to content

Commit dd8000f

Browse files
committed
Refactor EnterpriseSnackbar stories
1 parent 984b55e commit dd8000f

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { EnterpriseSnackbar } from "./EnterpriseSnackbar";
2+
3+
import type { Meta, StoryObj } from "@storybook/react";
4+
5+
const meta: Meta<typeof EnterpriseSnackbar> = {
6+
title: "components/EnterpriseSnackbar",
7+
component: EnterpriseSnackbar,
8+
};
9+
10+
export default meta;
11+
type Story = StoryObj<typeof EnterpriseSnackbar>;
12+
13+
export const Error: Story = {
14+
args: {
15+
variant: "error",
16+
open: true,
17+
message: "Oops, something wrong happened.",
18+
},
19+
};
20+
21+
export const Info: Story = {
22+
args: {
23+
variant: "info",
24+
open: true,
25+
message: "Hey, something happened.",
26+
},
27+
};
28+
29+
export const Success: Story = {
30+
args: {
31+
variant: "success",
32+
open: true,
33+
message: "Hey, something good happened.",
34+
},
35+
};

site/src/components/GlobalSnackbar/EnterpriseSnackbar/EnterpriseSnackbar.tsx renamed to site/src/components/GlobalSnackbar/EnterpriseSnackbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Snackbar, {
55
import { makeStyles } from "@mui/styles";
66
import CloseIcon from "@mui/icons-material/Close";
77
import { FC } from "react";
8-
import { combineClasses } from "../../../utils/combineClasses";
8+
import { combineClasses } from "utils/combineClasses";
99

1010
type EnterpriseSnackbarVariant = "error" | "info" | "success";
1111

site/src/components/GlobalSnackbar/EnterpriseSnackbar/EnterpriseSnackbar.stories.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

site/src/components/GlobalSnackbar/GlobalSnackbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { makeStyles } from "@mui/styles";
22
import { useCallback, useState, FC } from "react";
3-
import { useCustomEvent } from "../../hooks/events";
4-
import { CustomEventListener } from "../../utils/events";
5-
import { EnterpriseSnackbar } from "./EnterpriseSnackbar/EnterpriseSnackbar";
3+
import { useCustomEvent } from "hooks/events";
4+
import { CustomEventListener } from "utils/events";
5+
import { EnterpriseSnackbar } from "./EnterpriseSnackbar";
66
import { ErrorIcon } from "../Icons/ErrorIcon";
77
import { Typography } from "../Typography/Typography";
88
import {

0 commit comments

Comments
 (0)