-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
408ea99
commit a06116e
Showing
2 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
function EventTypeSelector({selected, onClick, children}) | ||
{ | ||
const selectorBaseStyle = `flex justify-center items-center px-8 py-2 rounded-t-lg text-body-m relative hover:bg-blue-50`; | ||
const selectedStyle = `text-blue-400 font-bold after:w-full after:h-1 after:absolute after:-bottom-px after:border-b-2 after:border-blue-400`; | ||
const unSelectedStyle = `text-neutral-800 hover:text-blue-400`; | ||
|
||
return <button type="button" className={`${selectorBaseStyle} ${selected ? selectedStyle : unSelectedStyle}`} onClick={onClick}>{children}</button> | ||
} | ||
|
||
function EventDetailInput({state, dispatch, mode}) | ||
{ | ||
function selectEventType(type) | ||
{ | ||
return ()=>{ | ||
if(mode === "edit") return; | ||
dispatch({type: "set_event_type", value:type}); | ||
} | ||
} | ||
|
||
return <div className="w-full"> | ||
<div className="flex w-full border-b border-neutral-200"> | ||
<EventTypeSelector selected={state.eventType === "fcfs"} onClick={selectEventType("fcfs")}> | ||
선착순 | ||
</EventTypeSelector> | ||
<EventTypeSelector selected={state.eventType === "draw"} onClick={selectEventType("draw")}> | ||
추첨 | ||
</EventTypeSelector> | ||
</div> | ||
<div className="flex-grow flex justify-center items-center p-4"> | ||
</div> | ||
</div> | ||
} | ||
|
||
export default EventDetailInput; |
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