-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced newsletter signup form in PNI product creep vote section wit…
…h the new implementation approach (#11791) * Replaced newsletter signup form in PNI product creep vote section with the new implementation approach * Remove obsolete code * code improvement * make sure Creep Vote section shows vote result after user has successfully signed up for newsletter
- Loading branch information
Showing
6 changed files
with
119 additions
and
86 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
34 changes: 34 additions & 0 deletions
34
source/js/components/newsletter-signup/atoms/button-quit.jsx
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 @@ | ||
import React from "react"; | ||
import classNames from "classnames"; | ||
import PropTypes from "prop-types"; | ||
|
||
const ButtonQuit = ({ | ||
children, | ||
buttonStyle = "primary", | ||
widthClasses = `tw-w-full`, | ||
handleQuitButtonClick, | ||
}) => { | ||
// [TODO] | ||
// Ideally styling for this "atom" component should be pre-defined in a Tailwind config file. | ||
// Because our design system still needs to be finalized, | ||
// we are using hardcoded Tailwind classes directly here for now. | ||
let classes = classNames( | ||
`tw-btn tw-btn-${buttonStyle} btn-dismiss`, | ||
widthClasses | ||
); | ||
|
||
return ( | ||
<button type="button" className={classes} onClick={handleQuitButtonClick}> | ||
{children} | ||
</button> | ||
); | ||
}; | ||
|
||
ButtonQuit.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
buttonStyle: PropTypes.oneOf(["primary", "secondary"]), | ||
widthClasses: PropTypes.string, | ||
handleQuitButtonClick: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default ButtonQuit; |
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