forked from codesquad-members-2023/issue-tracker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
197 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,25 @@ | ||
import { Dropdown, Tab, Button, InformationTag } from '@components/index'; | ||
import { IssuePage, IssueElement } from '@containers/index'; | ||
import { useState } from 'react'; | ||
import { useReducer } from 'react'; | ||
|
||
export function Test() { | ||
const [isDropdownOpen, setDropdownOpen] = useState(false); | ||
const [selected, setSelected] = useState('selected option1'); | ||
const handleDropdown = (isOpen) => { | ||
return () => setDropdownOpen(isOpen); | ||
}; | ||
const [active, setActive] = useState(null); | ||
const initialState = { count: 0 }; | ||
|
||
return ( | ||
<div> | ||
<Dropdown | ||
isOpen={isDropdownOpen} | ||
btnText={selected} | ||
hasRadioBtn={true} | ||
toggleOpen={handleDropdown(!isDropdownOpen)} | ||
options={[ | ||
{ | ||
id: 'test', | ||
profile: | ||
'https://s3.ap-northeast-2.amazonaws.com/image.themiilk.com/production/reporters/183650d33f1/e5c5004c6e_1663847761.png', | ||
contents: 'selected option1', | ||
}, | ||
{ | ||
id: 'test2', | ||
profile: 'https://assets.themiilk.com/test/test-profile1.png', | ||
contents: 'selected option2', | ||
}, | ||
]} | ||
header={'헤더'} | ||
selected={selected} | ||
optionOnClick={({ currentTarget }) => | ||
setSelected(currentTarget.innerText) | ||
} | ||
></Dropdown> | ||
function reducer(state, action) { | ||
switch (action.type) { | ||
case 'increment': | ||
return { count: state.count + 1 }; | ||
case 'decrement': | ||
return { count: state.count - 1 }; | ||
default: | ||
throw new Error(); | ||
} | ||
} | ||
|
||
<Tab | ||
buttonDatas={[ | ||
{ text: 'LEFT', icon: 'plus' }, | ||
{ text: 'RIGHT', icon: 'plus' }, | ||
]} | ||
active={active} | ||
_onClick={({ currentTarget }) => setActive(currentTarget.innerText)} | ||
></Tab> | ||
<Button iconName="plus" text="BUTTON" btnSize="l" color="blue"></Button> | ||
<Button text="BUTTON" btnSize="m" color="black"></Button> | ||
<Button text="BUTTON" btnSize="s" color="black"></Button> | ||
<InformationTag | ||
iconName="alertCircle" | ||
text="Label" | ||
bgColor="#007AFF" | ||
mode="light" | ||
></InformationTag> | ||
<InformationTag | ||
iconName="archive" | ||
text="Label" | ||
bgColor="red" | ||
mode="light" | ||
></InformationTag> | ||
<InformationTag text="Label" mode="neutral"></InformationTag> | ||
<IssuePage></IssuePage> | ||
<IssueElement | ||
iconName="alertCircle" | ||
title="이슈제목" | ||
label="레이블 이름" | ||
issueNumber="#3" | ||
timeStamp="2023-05-15" | ||
writer="sarang_daddy" | ||
mileStone="마일스톤" | ||
profile="https://assets.themiilk.com/test/test-profile1.png" | ||
></IssueElement> | ||
</div> | ||
export function Test() { | ||
const [state, dispatch] = useReducer(reducer, initialState); | ||
return ( | ||
<> | ||
Count: {state.count} | ||
<button onClick={() => dispatch({ type: 'decrement' })}>-</button> | ||
<button onClick={() => dispatch({ type: 'increment' })}>+</button> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.