-
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.
* Fix z-index of alert box * Move message to title * Add Color type at tailwindcss * Fix modal logic Promise를 씌우는 대신 Promise.resolve 를 동작시키도록 modal의 비즈니스 로직을 변경했습니다. * Rename `push` to `alert` * Remove unused function `close` * Split `Modal` component * Change `id` from `action` of actions element
- Loading branch information
Showing
7 changed files
with
133 additions
and
120 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,33 @@ | ||
import { Color } from "types/tailwindcss"; | ||
|
||
interface IModalProps { | ||
callback(action: string): void; | ||
title: string; | ||
message: string; | ||
actions: { | ||
id: string; | ||
color: Color; | ||
content: string; | ||
}[]; | ||
} | ||
|
||
export function Modal({ title, message, actions, callback }: IModalProps) { | ||
return ( | ||
<> | ||
<input type="checkbox" className="modal-toggle" defaultChecked={true} /> | ||
<div className="modal modal-bottom sm:modal-middle"> | ||
<div className="modal-box"> | ||
<h3 className="font-bold text-lg">{title}</h3> | ||
<p className="py-4 whitespace-pre-line keep-all">{message}</p> | ||
<div className="modal-action"> | ||
{actions.map(({ id, color, content }) => ( | ||
<label key={id} onClick={() => callback(id)} className={`btn btn-${color}`}> | ||
{content} | ||
</label> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export type Color = | ||
| "primary" | ||
| "secondary" | ||
| "accent" | ||
| "info" | ||
| "success" | ||
| "warning" | ||
| "error" | ||
| "ghost" | ||
| "link" | ||
| "outline" | ||
| "active" | ||
| "disabled"; |
03d798e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
umasupport-carrot – ./
umasupport-carrot-nabichan.vercel.app
umasupport-carrot-git-main-nabichan.vercel.app
umasupport-carrot.vercel.app