아토믹 디자인은 디자인 시스템을 만드는 하나의 방법론으로서 5개의 구분된 단계가 있다.
import React from 'react';
import styled from 'styled-components';
export const MemberBtn = ({ title = '회원정보 변경' }) => {
return <InfoChangeBtn title={title}>{title}</InfoChangeBtn>;
};
const InfoChangeBtn = styled.button`
width: ${props => (props.title === '회원탈퇴' ? '70px' : '108px')};
height: 32px;
margin: 10px;
color: #4186f5;
font-family: normal normal medium 14px/20px Source Han Sans KR;
background: #ffffff;
border: 1px solid #5287ed;
`;
import React from 'react';
import { Story, Meta } from '@storybook/react/types-6-0';
import { MemberBtn } from './MemberBtn';
export default {
title: 'practice/Atoms/MemberBtn',
component: MemberBtn,
argType: {
title: { control: 'title' },
},
} as Meta;
const Template: Story = args => <MemberBtn {...args} />;
export const Default = Template.bind({});
export const PwChangeBtn = Template.bind({});
PwChangeBtn.args = {
title: '비밀번호 변경',
};
export const MemberOutBtn = Template.bind({});
MemberOutBtn.args = {
title: '회원탈퇴',
};
import React from 'react';
import styled from 'styled-components';
import { mixin } from '~/styles';
import { MemberBtn } from '../BjAtoms/MemberBtn';
export const AllBtn = () => {
return (
<BtnSpace>
{BTN.map((title, idx) => {
return <MemberBtn key={idx} title={title} />;
})}
</BtnSpace>
);
};
const BTN = ['회원정보 변경', '비밀번호 변경', '회원탈퇴'];
const BtnSpace = styled.div`
margin: 30px 30px;
${mixin.flexSet()};
`;
import React from 'react';
import { Story, Meta } from '@storybook/react/types-6-0';
import { AllBtn } from './AllBtn';
export default {
title: 'practice/Molecules/AllBtn',
component: AllBtn,
} as Meta;
const Template: Story = args => <AllBtn {...args} />;
export const Default = Template.bind({});