-
Notifications
You must be signed in to change notification settings - Fork 0
/
add.sh
executable file
·74 lines (60 loc) · 1.54 KB
/
add.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
mkdir -p "./src/$1"
mkdir -p "./src/$1Outlined"
cat > "./src/$1/$1.presenter.tsx" << EOF
import React from "react";
import { IconProps } from "@/@types/IconProps";
import { BaseSvg } from "@/BaseSvg";
export const $1Icon = (props: IconProps) => {
return (
<BaseSvg
{...props}
>
</BaseSvg>
);
};
EOF
cat > "./src/$1/$1.stories.tsx" << EOF
import type { Meta, StoryObj } from "@storybook/react";
import { $1Icon } from "./$1.presenter";
interface Story extends StoryObj<typeof $1Icon> {}
const meta: Meta<typeof $1Icon> = {
component: $1Icon,
argTypes: {},
};
export default meta;
export const Default: Story = {};
EOF
cat > "./src/$1/index.tsx" << EOF
export * from "./$1.presenter"
EOF
cat > "./src/$1Outlined/$1Outlined.presenter.tsx" << EOF
import React from "react";
import { IconProps } from "@/@types/IconProps";
import { BaseSvg } from "@/BaseSvg";
export const ${1}OutlinedIcon = (props: IconProps) => {
return (
<BaseSvg
{...props}
>
</BaseSvg>
);
};
EOF
cat > "./src/$1Outlined/$1Outlined.stories.tsx" << EOF
import type { Meta, StoryObj } from "@storybook/react";
import { $1OutlinedIcon } from "./$1Outlined.presenter";
interface Story extends StoryObj<typeof $1OutlinedIcon> {}
const meta: Meta<typeof $1OutlinedIcon> = {
component: $1OutlinedIcon,
argTypes: {},
};
export default meta;
export const Default: Story = {};
EOF
cat > "./src/$1Outlined/index.tsx" << EOF
export * from "./$1Outlined.presenter"
EOF
cat >> "./src/index.tsx" << EOF
export * from "./$1";
export * from "./$1Outlined";
EOF