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

refactor(toast): Update toast styles #280

Merged
merged 1 commit into from
Oct 25, 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
9 changes: 7 additions & 2 deletions src/lib/components/toast/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const story = {
},
args: {
title: 'We couldn’t open the chat',
description: 'Description description description description description description description',
description: "We couldn't open the chat description. We couldn't open the chat description.",
action: {
title: 'Send an email',
onClick: () => {}
Expand All @@ -52,7 +52,12 @@ const FakeInlineToast = ({
type
}: Omit<ToastProps, 'onDismiss'>) => (
<div className='mb32'>
<div className={classNames(styles.toast, 'br8 bs-lg d-inline-flex')}>
<div
className={classNames(styles.toast, 'br8 bs-lg d-inline-flex')}
style={{
padding: "12px 20px"
}}
>
<Toast
title={title}
onDismiss={() => {}}
Expand Down
12 changes: 8 additions & 4 deletions src/lib/components/toast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ const Toast = ({
title,
type = "success"
}: ToastProps) => (
<div className='d-flex jc-between w100'>
<div
className={classNames(
styles.toastContent,
'd-flex jc-between w100'
)}>
<div
className={classNames(
styles.toastSidebar,
styles[`toastSidebar--${type}`]
)}
/>
<div className='mr16'>
<div className='d-flex fd-column jc-center ta-left mr8'>
<h4 className='p-h4'>{title}</h4>

{description && (
Expand All @@ -56,7 +60,7 @@ const Toast = ({
className={classNames(
styles.actionButton,
styles[`actionButton--${type}`],
'mt8 c-pointer'
'mt8 c-pointer ta-left'
)}
onClick={() => {
action.onClick();
Expand All @@ -75,7 +79,7 @@ const Toast = ({
onClick={onDismiss}
data-testid="toast-close-button"
>
<XIcon />
<XIcon size={24} />
</button>
</div>
</div>
Expand Down
14 changes: 9 additions & 5 deletions src/lib/components/toast/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
.toast {
position: relative;
margin: 0;
padding: 0;
width: 392px;
overflow: hidden;
padding: 20px 16px 20px 20px;
}

.toastContent {
padding: 4px 0 4px 8px;
}

.toastSidebar {
Expand Down Expand Up @@ -67,18 +71,18 @@
}

&--success {
color: $ds-green-700;
color: $ds-spearmint-700;

&:hover {
color: $ds-green-900;
color: $ds-spearmint-900;
}
}

&--information {
color: $ds-blue-500;
color: $ds-blue-700;

&:hover {
color: $ds-blue-700;
color: $ds-blue-900;
}
}

Expand Down
Loading