Skip to content

Commit

Permalink
[#997] React 化
Browse files Browse the repository at this point in the history
  • Loading branch information
okakyo committed Aug 22, 2023
1 parent d97ac74 commit 39ba753
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { WizNavigationItem } from "./navigation-item";
export { WizNavigationContainer } from "./navigation-container";
export {} from "./navigation-content";
export { WizNavigationContent } from "./navigation-content";
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import { navigationContentStyle } from "@wizleap-inc/wiz-ui-styles/bases/navigat
import { FC, ReactNode } from "react";

interface Props {
isOpen: boolean;
width?: string;
sticky?: boolean;
isOpen?: boolean;
children: ReactNode;
footer?: ReactNode;
}

const NavigationContent: FC<Props> = ({ isOpen, children }) => {
const NavigationContent: FC<Props> = ({ isOpen = false, children }) => {
const marginLeftStyle = isOpen ? "181px" : "61px";

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
} from "@/components/icons";

import { ButtonGroupItem } from "../../popup-button-group/types";
import { WizNavigationContainer, WizNavigationItem } from "../components";
import {
WizNavigationContainer,
WizNavigationItem,
WizNavigationContent,
} from "../components";

const meta: Meta<typeof WizNavigationContainer> = {
title: "Base/Navigation/Container",
Expand Down Expand Up @@ -125,10 +129,9 @@ export const Playground: Story = {
};

export const Fixed: Story = {
...Template,
args: {
isOpen: true,
sticky: true,
fixed: true,
footer: (
<div>
<h4>Footer</h4>
Expand All @@ -137,6 +140,26 @@ export const Fixed: Story = {
</div>
),
},
render: (args) => (
<div style={{ display: "flex", height: "100vh" }}>
<WizNavigationContainer {...args}>
{navItems.map((path) => (
<WizNavigationItem
key={`path-${path.label}`}
icon={path.icon}
label={path.label}
href="/"
active={false}
/>
))}
</WizNavigationContainer>
<WizNavigationContent isOpen={args.isOpen}>
<div style={{ paddingLeft: "36px", height: "120vh" }}>
<div>テスト テスト テスト</div>
</div>
</WizNavigationContent>
</div>
),
};

const createButton = (n: number): ButtonGroupItem => ({
Expand Down Expand Up @@ -206,6 +229,13 @@ const PopupTemplate: Story = {
onTogglePopupLocking={handleTogglePopupLocking}
/>
</WizNavigationContainer>
{args.fixed && (
<WizNavigationContent isOpen={args.isOpen}>
<div style={{ paddingLeft: "36px", height: "120vh" }}>
<div>テスト テスト テスト</div>
</div>
</WizNavigationContent>
)}
</div>
);
},
Expand All @@ -218,18 +248,18 @@ export const Popup: Story = {
},
};

export const PopupSticky: Story = {
export const PopupFixed: Story = {
...PopupTemplate,
args: {
isOpen: true,
sticky: true,
fixed: true,
},
};

export const Disabled: Story = {
args: {
isOpen: true,
sticky: true,
fixed: true,
},
render: (args) => (
<div style={{ display: "flex", height: "100vh" }}>
Expand All @@ -245,14 +275,19 @@ export const Disabled: Story = {
/>
))}
</WizNavigationContainer>
<WizNavigationContent isOpen={args.isOpen}>
<div style={{ paddingLeft: "36px", height: "120vh" }}>
<div>テスト テスト テスト</div>
</div>
</WizNavigationContent>
</div>
),
};

export const PopupAndTooltip: Story = {
args: {
isOpen: true,
sticky: true,
fixed: true,
},
render: (args) => {
const [isPopupOpen0, setIsPopupOpen0] = useState(false);
Expand Down Expand Up @@ -314,6 +349,11 @@ export const PopupAndTooltip: Story = {
tooltipText="これはヒント4です。"
/>
</WizNavigationContainer>
<WizNavigationContent isOpen={args.isOpen}>
<div style={{ paddingLeft: "36px", height: "120vh" }}>
<div>テスト テスト テスト</div>
</div>
</WizNavigationContent>
</div>
);
},
Expand Down

0 comments on commit 39ba753

Please sign in to comment.