mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: error icon, add only relevant variants (#5014)
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 <nicolae@getunleash.ai>
This commit is contained in:
		
							parent
							
								
									5f6c17f4bd
								
							
						
					
					
						commit
						2adfb7bd15
					
				| @ -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 { styled, Icon, Link } from '@mui/material'; | ||||||
| import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; | import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; | ||||||
| import { useNavigate } from 'react-router-dom'; | import { useNavigate } from 'react-router-dom'; | ||||||
| @ -37,13 +42,7 @@ const StyledIcon = styled('div', { | |||||||
|     color: theme.palette[variant].main, |     color: theme.palette[variant].main, | ||||||
| })); | })); | ||||||
| 
 | 
 | ||||||
| type BannerVariant = | type BannerVariant = 'warning' | 'info' | 'error' | 'success'; | ||||||
|     | 'warning' |  | ||||||
|     | 'info' |  | ||||||
|     | 'error' |  | ||||||
|     | 'success' |  | ||||||
|     | 'neutral' |  | ||||||
|     | 'secondary'; |  | ||||||
| 
 | 
 | ||||||
| export interface IMessageBanner { | export interface IMessageBanner { | ||||||
|     message: string; |     message: string; | ||||||
| @ -66,7 +65,7 @@ export const MessageBanner = ({ messageBanner }: IMessageBannerProps) => { | |||||||
| 
 | 
 | ||||||
|     const { |     const { | ||||||
|         message, |         message, | ||||||
|         variant = 'neutral', |         variant = 'info', | ||||||
|         sticky, |         sticky, | ||||||
|         icon, |         icon, | ||||||
|         link, |         link, | ||||||
| @ -103,10 +102,8 @@ export const MessageBanner = ({ messageBanner }: IMessageBannerProps) => { | |||||||
| const VariantIcons = { | const VariantIcons = { | ||||||
|     warning: <WarningAmber />, |     warning: <WarningAmber />, | ||||||
|     info: <InfoOutlined />, |     info: <InfoOutlined />, | ||||||
|     error: <Close />, |     error: <ErrorOutlineRounded />, | ||||||
|     success: <Check />, |     success: <Check />, | ||||||
|     neutral: <InfoOutlined />, |  | ||||||
|     secondary: <InfoOutlined />, |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| interface IBannerIconProps { | interface IBannerIconProps { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user