Skip to content

Commit

Permalink
fix: error icon, add only relevant variants (#5014)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-1508/fix-message-banner-error-variant-icon

After aligning with @nicolaesocaciu, we fixed the `error` variant icon
and removed irrelevant message variants for now.

Co-authored-by: Nicolae <[email protected]>
  • Loading branch information
nunogois and Nicolae authored Oct 12, 2023
1 parent 5f6c17f commit 2adfb7b
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Check, Close, InfoOutlined, WarningAmber } from '@mui/icons-material';
import {
Check,
ErrorOutlineRounded,
InfoOutlined,
WarningAmber,
} from '@mui/icons-material';
import { styled, Icon, Link } from '@mui/material';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -37,13 +42,7 @@ const StyledIcon = styled('div', {
color: theme.palette[variant].main,
}));

type BannerVariant =
| 'warning'
| 'info'
| 'error'
| 'success'
| 'neutral'
| 'secondary';
type BannerVariant = 'warning' | 'info' | 'error' | 'success';

export interface IMessageBanner {
message: string;
Expand All @@ -66,7 +65,7 @@ export const MessageBanner = ({ messageBanner }: IMessageBannerProps) => {

const {
message,
variant = 'neutral',
variant = 'info',
sticky,
icon,
link,
Expand Down Expand Up @@ -103,10 +102,8 @@ export const MessageBanner = ({ messageBanner }: IMessageBannerProps) => {
const VariantIcons = {
warning: <WarningAmber />,
info: <InfoOutlined />,
error: <Close />,
error: <ErrorOutlineRounded />,
success: <Check />,
neutral: <InfoOutlined />,
secondary: <InfoOutlined />,
};

interface IBannerIconProps {
Expand Down

0 comments on commit 2adfb7b

Please sign in to comment.