Skip to content

Commit

Permalink
fix: toast icon shrink horizontally & lose ratio on smaller viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed Jul 20, 2023
1 parent d65ea13 commit a1f2373
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions packages/ui/src/molecules/ToastBar/ToastBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,21 @@ const ToastBar = ({ toast }: ToastBarProps) => {
{...toast.ariaProps}
>
{useMemo(() => {
const commonCss = {
flexShrink: 0,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '4rem',
height: '4rem',
borderRadius: '2rem',
}

if (toast.icon !== undefined) {
return (
<div
css={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '4rem',
height: '4rem',
borderRadius: '2rem',
...commonCss,
backgroundColor: toast.iconTheme?.primary,
color: toast.iconTheme?.secondary,
}}
Expand All @@ -90,12 +95,7 @@ const ToastBar = ({ toast }: ToastBarProps) => {
return (
<div
css={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '4rem',
height: '4rem',
borderRadius: '2rem',
...commonCss,
backgroundColor: 'rgba(56, 212, 72, 0.25)',
color: '#38D448',
}}
Expand All @@ -107,12 +107,7 @@ const ToastBar = ({ toast }: ToastBarProps) => {
return (
<div
css={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '4rem',
height: '4rem',
borderRadius: '2rem',
...commonCss,
backgroundColor: 'rgba(210, 36, 36, 0.25)',
color: '#D22424',
}}
Expand Down

0 comments on commit a1f2373

Please sign in to comment.