Skip to content

Commit

Permalink
Refactor Message style for different type
Browse files Browse the repository at this point in the history
  • Loading branch information
leonbit2022 committed Sep 15, 2023
1 parent 7e2f292 commit e0086f7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/example/src/kits/Message/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ export const MessageContent = styled.div`

export const MessageCopy = styled.span<{ type: MessageType }>`
font-weight: 600;
color: ${(props) =>
props.type === MessageType.Error ? '#F54814' : (
props.type === MessageType.Succeed ? '#21A35D' : '#1F69FF'
)};
color: ${(props) => ({
[MessageType.Error]: '#F54814',
[MessageType.Succeed]: '#21A35D',
[MessageType.Info]: '#1F69FF',
}[props.type])};
`;

0 comments on commit e0086f7

Please sign in to comment.