feature/storybook #2

Merged
behnam merged 7 commits from feature/storybook into develop 2024-11-26 15:42:17 +00:00
3 changed files with 18 additions and 20 deletions
Showing only changes of commit 2bb8afa51e - Show all commits

View File

@ -8,14 +8,12 @@ import createInvoiceUsecase from "@/feature/core/invoice/domain/usecase/create-i
import type { Meta } from "@storybook/react"; import type { Meta } from "@storybook/react";
import { useRef } from "react"; import { useRef } from "react";
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta: Meta = { const meta: Meta = {
title: "general/Button", title: "general/Button",
}; };
export default meta; export default meta;
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
export const Primary: Story = { export const Primary: Story = {
argTypes: { argTypes: {
"vm.props.isDisable": { "vm.props.isDisable": {
@ -35,18 +33,18 @@ export const Primary: Story = {
} }
}; };
export const WithVM: Story = { // export const WithVM: Story = {
decorators: [ // decorators: [
(Story) => { // (Story) => {
return <Story /> // return <Story />
} // }
], // ],
render: () => { // render: () => {
const Child = () => { // const Child = () => {
const di = useDI(); // const di = useDI();
const vm = useRef(di.resolve(CreateRandomInvoiceButtonVM)); // const vm = useRef(di.resolve(CreateRandomInvoiceButtonVM));
return <Button vm={vm.current} memoizedByVM={false} /> // return <Button vm={vm.current} memoizedByVM={false} />
} // }
return (<DiContext.Provider value={dashboardAppModule()}> <Child /> </ DiContext.Provider>) // return (<DiContext.Provider value={dashboardAppModule()}> <Child /> </ DiContext.Provider>)
} // }
} // }

View File

@ -34,7 +34,7 @@ body {
--chart-5: 27 87% 67%; --chart-5: 27 87% 67%;
--radius: 0.5rem; --radius: 0.5rem;
} }
.dark { :root[class~="dark"] {
--background: 240 10% 3.9%; --background: 240 10% 3.9%;
--foreground: 0 0% 98%; --foreground: 0 0% 98%;
--card: 240 10% 3.9%; --card: 240 10% 3.9%;