-
Notifications
You must be signed in to change notification settings - Fork 30
AAA I can set an announcement with funnels and CTA button #1440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 54 commits
ffe0f3b
659a5c4
40cf2f9
899a3f0
81180bb
8b694f7
3074528
91c882a
48653ae
c7fb982
4a18ef3
9ce4fab
3585573
14e353b
9a37437
f93fdc0
4e7eafe
fcd796a
a62d41a
332ea6a
8a74cea
ab6186d
fbbebcd
7f30e59
0a25561
16b3be4
8445fd3
07e357d
985b616
e21bde4
3f689b8
0e0352d
07f250c
52739ac
de68584
3adc804
d8b731f
44581e4
3f16d02
68b92ab
7eb5c07
297dca6
220c0f6
ed799a1
c8f54e7
d72ae7b
a0b5de8
bf7f576
a509b53
d93f7db
b0a1908
f4d50ec
cc3ea03
059ddbc
515bb0d
a4e73af
1223c52
bf4ee63
271ce1e
4c96067
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
@import "scss/constants.scss"; | ||
|
||
.ConfirmationModal { | ||
.modal-content { | ||
background: $modal-background--confirm; | ||
} | ||
text-align: center; | ||
|
||
&__message { | ||
padding: 10px 0 30px 0; | ||
} | ||
|
||
&__buttons { | ||
display: flex; | ||
width: 70%; | ||
margin: 0 auto; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,22 +11,23 @@ interface ConfirmationModalProps { | |
show?: boolean; | ||
header?: string; | ||
message: string; | ||
no?: string; | ||
yes?: string; | ||
cancelBtnLabel?: string; | ||
saveBtnLabel?: string; | ||
centered?: boolean; | ||
alexxpetrov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onConfirm: () => void; | ||
onCancel?: () => void; | ||
isCentered?: boolean; | ||
alexxpetrov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ | ||
show, | ||
header, | ||
message, | ||
no = "No", | ||
yes = "Yes", | ||
centered = true, | ||
onConfirm, | ||
onCancel, | ||
cancelBtnLabel = "No", | ||
saveBtnLabel = "Yes", | ||
isCentered = false, | ||
}) => { | ||
const [isVisible, setIsVisible] = useState(true); | ||
|
||
|
@@ -49,20 +50,15 @@ export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ | |
const isShown = show !== undefined ? show : isVisible; | ||
|
||
return ( | ||
<Modal | ||
className="ConfirmationModal" | ||
show={isShown} | ||
onHide={hide} | ||
centered={centered} | ||
> | ||
<Modal show={isShown} onHide={hide} centered={isCentered}> | ||
<Modal.Body> | ||
<div> | ||
{hasHeader && <Modal.Title>{header}</Modal.Title>} | ||
<div className="ConfirmationModal"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the class of the ConfirmationModal is moved? it should be set on the container element. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's still a container class for the confirmation content body There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, let's say we want to change the background of the confirmation modal. If we change it for the current ".ConfirmationModal" selector, it'll look this way, leaving black borders (see the screenshot). But if we assign this class name to the Modal component, we'll be able to target a child to change the background of the needed element. |
||
{hasHeader && <h4>{header}</h4>} | ||
<div className="ConfirmationModal__message">{message}</div> | ||
<div className="ConfirmationModal__buttons"> | ||
<ButtonNG onClick={cancel}>{no}</ButtonNG> | ||
<ButtonNG variant="primary" onClick={confirm}> | ||
{yes} | ||
<ButtonNG onClick={cancel}>{cancelBtnLabel}</ButtonNG> | ||
<ButtonNG variant="danger" onClick={confirm}> | ||
alexxpetrov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{saveBtnLabel} | ||
</ButtonNG> | ||
</div> | ||
</div> | ||
|
Uh oh!
There was an error while loading. Please reload this page.