-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2530 from Giveth/release-2.14.8
Release 2.14.8
- Loading branch information
Showing
29 changed files
with
828 additions
and
600 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { | ||
neutralColors, | ||
semanticColors, | ||
SublineBold, | ||
} from '@giveth/ui-design-system'; | ||
import React, { FC } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
export enum EBadgeStatus { | ||
DEFAULT, | ||
WARNING, | ||
ERROR, | ||
SUCCESS, | ||
} | ||
|
||
interface IBadge { | ||
label: string; | ||
status: EBadgeStatus; | ||
showBullet?: boolean; | ||
className?: string; | ||
} | ||
|
||
const badgeStatusToColor = (status: EBadgeStatus) => { | ||
switch (status) { | ||
case EBadgeStatus.DEFAULT: | ||
return neutralColors.gray; | ||
case EBadgeStatus.WARNING: | ||
return semanticColors.golden; | ||
case EBadgeStatus.ERROR: | ||
return semanticColors.punch; | ||
case EBadgeStatus.SUCCESS: | ||
return semanticColors.jade; | ||
default: | ||
return neutralColors.gray; | ||
} | ||
}; | ||
|
||
export const Badge: FC<IBadge> = ({ label, status, showBullet, className }) => { | ||
return ( | ||
<BadgeContainer | ||
className={className} | ||
mainColor={badgeStatusToColor(status)} | ||
> | ||
{showBullet && <BulletPoint>•</BulletPoint>} | ||
<SublineBold>{label}</SublineBold> | ||
</BadgeContainer> | ||
); | ||
}; | ||
|
||
interface IBadgeContainer { | ||
mainColor: any; | ||
} | ||
|
||
export const BadgeContainer = styled.span<IBadgeContainer>` | ||
display: flex; | ||
align-items: center; | ||
color: ${props => props.mainColor[700]} !important; | ||
background: ${props => props.mainColor[100]}; | ||
border: 2px solid ${props => props.mainColor[300]}; | ||
border-radius: 50px; | ||
padding: 2px 8px; | ||
height: 24px; | ||
`; | ||
|
||
const BulletPoint = styled.div` | ||
font-size: 18px; | ||
margin-right: 4px; | ||
padding: 0; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
09b9a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
giveth-dapps-v2 – ./
giveth-dapps-v2-givethio.vercel.app
giveth-dapps-v2-git-main-givethio.vercel.app
giveth.io
www.giveth.io