-
Notifications
You must be signed in to change notification settings - Fork 47
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 #819 from gympass/EXUX-888-feature
feat: [EXUX-888] Include new Badge component
- Loading branch information
Showing
8 changed files
with
167 additions
and
70 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,28 @@ | ||
import React from 'react'; | ||
|
||
import { string, node } from 'prop-types'; | ||
|
||
import Box from '../../Box'; | ||
import Icon from '../../Icon'; | ||
|
||
const BADGE_SIZE = 10.67; | ||
|
||
const Badge = ({ icon, fill, ...props }) => ( | ||
<Box | ||
justifyContent="center" | ||
alignItems="center" | ||
borderRadius="circle" | ||
w="small" | ||
h="small" | ||
{...props} | ||
> | ||
<Icon as={icon} size={BADGE_SIZE} fill={fill} /> | ||
</Box> | ||
); | ||
|
||
Badge.propTypes = { | ||
icon: node.isRequired, | ||
fill: string.isRequired, | ||
}; | ||
|
||
export default Badge; |
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,38 @@ | ||
import styled from 'styled-components'; | ||
|
||
import Box from '../../../Box'; | ||
|
||
export const StyledBox = styled(Box)` | ||
width: 100%; | ||
border-bottom-width: ${({ divided }) => (divided ? 1 : 0)}px; | ||
border-bottom-color: ${({ | ||
theme: { | ||
yoga: { | ||
colors: { | ||
elements: { lineAndBorders }, | ||
}, | ||
}, | ||
}, | ||
}) => lineAndBorders}; | ||
`; | ||
|
||
export const Content = styled.View` | ||
flex: 1; | ||
${({ | ||
theme: { | ||
yoga: { | ||
spacing: { small, large }, | ||
}, | ||
}, | ||
}) => { | ||
return ` | ||
margin-left: ${small}px; | ||
margin-bottom: ${large}px; | ||
`; | ||
}} | ||
`; | ||
|
||
export const TitleAndBadgeContainer = styled(Box)` | ||
flex-direction: row; | ||
align-items: center; | ||
`; |