Skip to content

Instantly share code, notes, and snippets.

@kwoncharles
Last active December 27, 2020 13:58
Show Gist options
  • Select an option

  • Save kwoncharles/f0785e787883bcbed7d3ad18e9e23276 to your computer and use it in GitHub Desktop.

Select an option

Save kwoncharles/f0785e787883bcbed7d3ad18e9e23276 to your computer and use it in GitHub Desktop.
apropcalypse
/* 컴포넌트 탄생! 깔끔하다 ✨ */
<Dialog
title="안내"
description="이것은 멋진 내용을 담고 있는 안내입니다."
button={{
label: '확인',
onClick: doSomething,
}}
/>
/**************************/
/********* 1주일 뒤 *********/
/**************************/
/**
* "다이얼로그 버튼이 하단에 있던데, 상단에 있는 경우도 필요합니다!"
*
* -> props 추가 (buttonPosition)
*/
<Dialog
title="안내"
description="이것은 멋진 내용을 담고 있는 안내입니다."
button={{
label: '확인',
onClick: doSomething
}}
buttonPosition="top"
/>
/**************************/
/********* 2주일 뒤 *********/
/**************************/
/**
* "두 개의 버튼이 있는 다이얼로그가 필요해요! 둘 중 하나는 Primary, 하나는 Secondary 타입으로요"
*
* -> props 변경 (button -> buttons, variant 추가)
*/
<Dialog
title="안내"
description="이것은 멋진 내용을 담고 있는 안내입니다."
buttonPosition="top"
buttons={[
{
label: '확인',
onClick: doSomething,
variant: 'primary',
}, {
label: '취소',
onClick: doSomethingElse,
variant: 'secondary',
},
]}
/>
/**************************/
/********* 1개월 뒤 *********/
/**************************/
/**
* "버튼이 세로로 나열되어 있는 다이얼로그도 추가해주세요!"
* "title 위에 아이콘도 하나 넣어주세요!"
*
* -> props 추가 (buttonAlign, iconAboveTitle)
*/
<Dialog
title="안내"
description="이것은 멋진 내용을 담고 있는 안내입니다."
buttonPosition="top"
buttons={[
{
label: '확인',
onClick: doSomething,
variant: 'primary',
}, {
label: '취소',
onClick: doSomethingElse,
variant: 'secondary',
},
]}
buttonAlign="vertical"
iconAboveTitle="fancy-icon"
/>
/**************************/
/********* 6개월 뒤 *********/
/**************************/
<Dialog
{...프많쓰않} // 프롭스가 많지만 쓰지 않는다
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment