Skip to content

Commit

Permalink
fix(react-ui): add content wrapper and set max width for notification…
Browse files Browse the repository at this point in the history
… component (#1028)

* fix(react-ui): add wrapper for notification component

* chore: add changeset for react-ui notification update

* fix(react-ui): move spacing to wrapper
  • Loading branch information
realdreamer authored Oct 11, 2023
1 parent 90c69ce commit 80c680d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-shrimps-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kadena/react-ui': minor
---

Add max-width to notification content
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@ export const containerClass = style([
alignItems: 'flex-start',
borderRadius: '$sm',
padding: '$md',
gap: '$md',
borderStyle: 'solid',
justifyContent: 'center',
}),
{
borderLeftWidth: vars.sizes.$1,
},
]);

export const containerWrapperClass = style([
sprinkles({
display: 'flex',
width: '100%',
alignItems: 'flex-start',
gap: '$md',
}),
{
maxWidth: 1440,
},
]);

export const cardColorVariants = styleVariants(colorVariants, (color) => {
return [
sprinkles({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
closeButtonClass,
colorVariants,
containerClass,
containerWrapperClass,
contentClass,
descriptionClass,
displayVariants,
Expand Down Expand Up @@ -60,22 +61,24 @@ export const NotificationContainer: FC<INotificationProps> = ({

return (
<div className={classList}>
<Icon size="md" />
<div className={containerWrapperClass}>
<Icon size="md" />

<div className={contentClassList}>
{title && <h4>{title}</h4>}
<div className={descriptionClassList}>{children}</div>
</div>
<div className={contentClassList}>
{title && <h4>{title}</h4>}
<div className={descriptionClassList}>{children}</div>
</div>

{hasCloseButton && (
<button
className={closeButtonClass}
onClick={onClose}
aria-label="Close Notification"
>
<SystemIcon.Close size="md" />
</button>
)}
{hasCloseButton && (
<button
className={closeButtonClass}
onClick={onClose}
aria-label="Close Notification"
>
<SystemIcon.Close size="md" />
</button>
)}
</div>
</div>
);
};

1 comment on commit 80c680d

@vercel
Copy link

@vercel vercel bot commented on 80c680d Oct 11, 2023

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:

react-ui – ./packages/libs/react-ui

react-ui-git-main-kadena-js.vercel.app
react-ui.kadena.io
react-ui-delta.vercel.app
react-ui-kadena-js.vercel.app

Please sign in to comment.