Skip to content
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

feature/OP-136/NotificationPopUp #153

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- **Version 2.2 (breaking changes from 2.1.x)**

- 2.2.26: Updated NotificationPopUp secondary button to have hover and href.
- 2.2.25:
- Added box-shadow to CardWrapper.
- Added item border-radius to PrimaryTopNav.
Expand Down
72 changes: 41 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@conduction/components",
"version": "2.2.25",
"version": "2.2.26",
"description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
"main": "lib/index.js",
"scripts": {
Expand All @@ -23,7 +23,7 @@
"@fortawesome/fontawesome-svg-core": "^6.2.0",
"@fortawesome/free-solid-svg-icons": "^6.2.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@utrecht/component-library-react": "^1.0.0-alpha.319",
"@utrecht/component-library-react": "1.0.0-alpha.394",
"clsx": "^1.1.1",
"gatsby": "^4.11.1",
"react": "^18.2.0",
Expand Down
15 changes: 11 additions & 4 deletions src/components/notificationPopUp/NotificationPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ export interface NotificationPopUpProps {
hide: () => void;
primaryButton: {
label: string;
icon?: JSX.Element;
handleClick: () => any;
icon?: JSX.Element;
layoutClassName?: string;
};
secondaryButton?: {
label: string;
icon?: JSX.Element;
handleClick: () => any;
href: string;
icon?: JSX.Element;
layoutClassName?: string;
};
layoutClassName?: string;
Expand Down Expand Up @@ -59,8 +60,14 @@ export const NotificationPopUp = ({

<div className={styles.buttons}>
{secondaryButton && (
<div onClick={() => handleClick(secondaryButton.handleClick)} className={secondaryButton.layoutClassName}>
<Link className={styles.link}>
<div className={secondaryButton.layoutClassName}>
<Link
onClick={(e) => {
e.preventDefault(), handleClick(secondaryButton.handleClick);
}}
className={styles.link}
href={secondaryButton.href}
>
{secondaryButton.icon ?? <FontAwesomeIcon icon={faClose} />}
{secondaryButton.label}
</Link>
Expand Down