forked from rubizza-camp/retrospective
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a popup to confirm cancel assigning
- Loading branch information
1 parent
13eff6d
commit 4303083
Showing
15 changed files
with
327 additions
and
28 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
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
17 changes: 17 additions & 0 deletions
17
app/javascript/components/shared/modal-confirm/confirm-comment.tsx
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,17 @@ | ||
import React, {useState} from "react"; | ||
|
||
import style from './modal-confirm.module.less'; | ||
|
||
const ConfirmComment: React.FC = () => { | ||
const [confirmComment, setConfirmComment] = useState(""); | ||
console.log(confirmComment); | ||
return ( | ||
<textarea | ||
className={style.confirmComment} | ||
value={confirmComment} | ||
onChange={(evt) => setConfirmComment(evt.target.value)} | ||
/> | ||
); | ||
}; | ||
|
||
export default ConfirmComment; |
14 changes: 14 additions & 0 deletions
14
app/javascript/components/shared/modal-confirm/modal-confirm.module.less
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,14 @@ | ||
.modalTitle { | ||
margin-bottom: 20px; | ||
text-align: center; | ||
} | ||
|
||
.buttons { | ||
display: flex; | ||
justify-content: center; | ||
gap: 20px; | ||
} | ||
|
||
.buttons button { | ||
margin: 0; | ||
} |
46 changes: 46 additions & 0 deletions
46
app/javascript/components/shared/modal-confirm/modal-confirm.tsx
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,46 @@ | ||
import React from "react"; | ||
|
||
import style from "./modal-confirm.module.less"; | ||
|
||
interface ModalConfirmProps { | ||
textModal: string, | ||
onConfirm: () => void, | ||
onCancel: () => void, | ||
disabledButton: boolean | ||
} | ||
|
||
const ModalConfirm: React.FC<ModalConfirmProps> = ({ | ||
textModal, | ||
children, | ||
onConfirm, | ||
onCancel, | ||
disabledButton}) => { | ||
return ( | ||
<div> | ||
<div> | ||
<h4 className={style.modalTitle}>{textModal}</h4> | ||
</div> | ||
|
||
{children} | ||
|
||
<div className={style.buttons}> | ||
<button | ||
className="button delete-button" | ||
onClick={() => onConfirm()} | ||
disabled={disabledButton} | ||
> | ||
Confirm | ||
</button> | ||
<button | ||
type="button" | ||
className="button cancel-button" | ||
onClick={() => onCancel()} | ||
> | ||
Cancel | ||
</button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ModalConfirm; |
Oops, something went wrong.