Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

Commit c8e69bd

Browse files
committed
refactor: extract stories and simplifed
1 parent ef24bf7 commit c8e69bd

File tree

54 files changed

+590
-1259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+590
-1259
lines changed

main/uis/Button/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ export function Button({
347347
style={[
348348
style,
349349
css`
350+
flex-direction: row;
350351
border-radius: ${borderRadius + 'px'};
351352
`,
352353
]}

main/uis/Checkbox/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ export function Checkbox({
112112
padding: 6px 0;
113113
114114
flex-direction: row;
115-
column-gap: 6px;
115+
column-gap: 2px;
116+
align-items: center;
116117
`,
117118
styles?.container,
118119
]}

main/uis/EditText/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,17 @@ type CustomRenderType =
5353
export type EditTextProps = {
5454
testID?: TextInputProps['testID'];
5555
inputRef?: MutableRefObject<TextInput | undefined> | RefObject<TextInput>;
56-
required?: boolean;
57-
5856
style?: StyleProp<ViewStyle>;
5957
styles?: EditTextStyles;
6058

6159
// Components
62-
label?: string | RenderType;
63-
error?: string | RenderType;
6460
startElement?: JSX.Element | CustomRenderType;
6561
endElement?: JSX.Element | CustomRenderType;
66-
62+
required?: boolean;
63+
label?: string | RenderType;
64+
error?: string | RenderType;
6765
direction?: 'row' | 'column';
6866
decoration?: 'underline' | 'boxed';
69-
7067
value?: TextInputProps['value'];
7168
multiline?: TextInputProps['multiline'];
7269
onChange?: TextInputProps['onChange'];

main/uis/Icon/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,14 +3782,14 @@ export const doobooIconList = [
37823782
export type IconNames = typeof doobooIconList;
37833783
export type IconName = IconNames[number];
37843784

3785-
type Props = {
3785+
export type IconProps = {
37863786
name: IconName;
37873787
size?: number;
37883788
color?: string;
37893789
style?: ViewStyle;
37903790
};
37913791

3792-
const Ico: FC<Props> = createIconSetFromIcoMoon(
3792+
const Ico: FC<IconProps> = createIconSetFromIcoMoon(
37933793
collectingFontIconSelection,
37943794
'doobooui',
37953795
require('./doobooui.ttf'),

main/uis/LoadingIndicator/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ type Styles = {
1313
image?: ImageStyle;
1414
};
1515

16-
interface Props {
16+
type Props = {
1717
style?: StyleProp<ViewStyle>;
1818
styles?: Styles;
1919
color?: string;
2020
size?: ActivityIndicator['props']['size'];
2121
imgSource?: string | ImageSourcePropType;
2222
customElement?: JSX.Element | (() => JSX.Element);
23-
}
23+
};
2424

2525
export function LoadingIndicator({
2626
customElement,

main/uis/NetworkImage/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ const Container = styled.View`
1818
align-items: center;
1919
`;
2020

21-
interface Props {
21+
type Props = {
2222
style?: StyleProp<ViewStyle>;
2323
url: string | undefined;
2424
loadingSource?: ImageSourcePropType | JSX.Element;
2525
imageProps?: Partial<ImageProps>;
2626
shouldFixImageRatio?: boolean;
27-
}
27+
};
2828

2929
function NetworkImage(props: Props): JSX.Element {
3030
const {themeType} = useTheme();

stories/modals/AlertDialogStories/AlertDialog.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {Meta, StoryObj} from '@storybook/react';
33

44
import {DoobooProvider} from '../../../main';
55
import type AlertDialog from '../../../main/modals/AlertDialog';
6+
import {StoryContainer} from '../../GlobalStyles';
67

78
import Component from './AlertDialogBasicStory';
89

@@ -13,7 +14,9 @@ const meta = {
1314
decorators: [
1415
(Story) => (
1516
<DoobooProvider>
16-
<Story />
17+
<StoryContainer>
18+
<Story />
19+
</StoryContainer>
1720
</DoobooProvider>
1821
),
1922
],

stories/modals/SnackbarStories/Snackbar.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {Meta, StoryObj} from '@storybook/react';
33

44
import {DoobooProvider} from '../../../main';
55
import type Snackbar from '../../../main/modals/Snackbar';
6+
import {StoryContainer} from '../../GlobalStyles';
67

78
import Component from './SnackbarBasicStory';
89

@@ -13,7 +14,9 @@ const meta = {
1314
decorators: [
1415
(Story) => (
1516
<DoobooProvider>
16-
<Story />
17+
<StoryContainer>
18+
<Story />
19+
</StoryContainer>
1720
</DoobooProvider>
1821
),
1922
],
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import type {ComponentProps} from 'react';
2+
import type {Meta, StoryObj} from '@storybook/react';
3+
4+
import {DoobooProvider} from '../../main';
5+
import CalendarCarousel from '../../packages/CalendarCarousel';
6+
import {StoryContainer} from '../GlobalStyles';
7+
8+
const meta = {
9+
title: 'CalendarCarousel',
10+
component: (props) => (
11+
<CalendarCarousel
12+
initialSelectedDate={new Date(2024, 11, 4)}
13+
showNextDates={true}
14+
showPrevDates={true}
15+
width={350}
16+
{...props}
17+
// headerIconLeft={
18+
// <Icon color={theme.text.basic} name="ArrowCircleLeft" size={18} />
19+
// }
20+
// headerIconRight={
21+
// <Icon color={theme.text.basic} name="ArrowCircleRight" size={18} />
22+
// }
23+
// locale={ko}
24+
// style={css`
25+
// margin-top: 80px;
26+
// `}
27+
/>
28+
),
29+
argTypes: {
30+
initialSelectedDate: {
31+
control: 'date',
32+
},
33+
showNextDates: {
34+
control: 'boolean',
35+
},
36+
showPrevDates: {
37+
control: 'boolean',
38+
},
39+
width: {
40+
control: 'number',
41+
},
42+
},
43+
decorators: [
44+
(Story) => (
45+
<DoobooProvider>
46+
<StoryContainer>
47+
<Story />
48+
</StoryContainer>
49+
</DoobooProvider>
50+
),
51+
],
52+
} satisfies Meta<ComponentProps<typeof CalendarCarousel>>;
53+
54+
export default meta;
55+
56+
type Story = StoryObj<typeof meta>;
57+
58+
export const Basic: Story = {
59+
args: {},
60+
};

stories/packages/CalendarCarouselStories/CalendarCarousel.stories.tsx

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

stories/packages/CalendarCarouselStories/CalendarCarouselBasicStory.tsx

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

stories/packages/PinchZoomStories/PinchZoom.stories.tsx renamed to stories/packages/PinchZoom.stories.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type {ComponentProps} from 'react';
22
import type {Meta, StoryObj} from '@storybook/react';
33

4-
import {DoobooProvider} from '../../../main';
5-
import type {PinchZoom} from '../../../packages/PinchZoom';
4+
import {DoobooProvider} from '../../main';
5+
import type {PinchZoom} from '../../packages/PinchZoom/lib';
6+
import {StoryContainer} from '../GlobalStyles';
67

7-
import Component from './PinchZoomImageListStory';
8+
import Component from './PinchZoomStories/PinchZoomImageListStory';
89

910
const meta = {
1011
title: 'PinchZoom',
@@ -14,7 +15,9 @@ const meta = {
1415
decorators: [
1516
(Story) => (
1617
<DoobooProvider>
17-
<Story />
18+
<StoryContainer>
19+
<Story />
20+
</StoryContainer>
1821
</DoobooProvider>
1922
),
2023
],

stories/uis/AccordionStories/Accordion.stories.tsx renamed to stories/uis/Accordion.stories.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import type {ComponentProps} from 'react';
22
import {action} from '@storybook/addon-actions';
33
import type {Meta, StoryObj} from '@storybook/react';
44

5-
import type {Accordion} from '../../../main';
6-
import {DoobooProvider} from '../../../main';
7-
8-
import AccordionBasicStory from './AccordionBasicStory';
5+
import {Accordion, DoobooProvider} from '../../main';
6+
import {StoryWrapper} from '../Common';
97

108
// @ts-ignore
119
const meta = {
1210
title: 'Accordion',
13-
component: AccordionBasicStory,
11+
component: (props) => <Accordion {...props} />,
1412
decorators: [
1513
(Story) => (
1614
<DoobooProvider>
17-
<Story />
15+
<StoryWrapper>
16+
<Story />
17+
</StoryWrapper>
1818
</DoobooProvider>
1919
),
2020
],

0 commit comments

Comments
 (0)