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

fix(react-ui): add content wrapper and set max width for notification component #1028

Merged
merged 3 commits into from
Oct 11, 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
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>
);
};