Skip to content

Commit

Permalink
Merge pull request #822 from gympass/EXUX-912
Browse files Browse the repository at this point in the history
fix: [EXUX-912] Add extra margin to result title and badge container
  • Loading branch information
matheushdsbr authored May 29, 2024
2 parents f94d408 + e1f86a2 commit ac9d3ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,15 @@ exports[`<Result /> should match snapshot 1`] = `
</View>
</View>
<View
alignItems="center"
flexDirection="row"
marginRight="zero"
style={
[
{
"alignItems": "center",
"flexDirection": "row",
"marginRight": 0,
},
]
}
Expand Down Expand Up @@ -1180,11 +1184,15 @@ exports[`<Result /> should match snapshot without attendence 1`] = `
}
>
<View
alignItems="center"
flexDirection="row"
marginRight="zero"
style={
[
{
"alignItems": "center",
"flexDirection": "row",
"marginRight": 0,
},
]
}
Expand Down Expand Up @@ -2074,11 +2082,15 @@ exports[`<Result /> should match snapshot without limitLabel prop 1`] = `
</View>
</View>
<View
alignItems="center"
flexDirection="row"
marginRight="zero"
style={
[
{
"alignItems": "center",
"flexDirection": "row",
"marginRight": 0,
},
]
}
Expand Down
11 changes: 8 additions & 3 deletions packages/yoga/src/Result/native/Result/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import React, { isValidElement } from 'react';
import { arrayOf, string, shape, func, bool, node } from 'prop-types';

import Text from '../../../Text';
import Box from '../../../Box';
import Attendances from '../Attendances';
import Badge from '../Badge';

import { Content, StyledBox, TitleAndBadgeContainer } from './styles';
import { Content, StyledBox } from './styles';

/**
* The Result component is used when you have a list to show. It is applied to
Expand All @@ -33,7 +34,11 @@ const Result = ({
color={attendancesColor}
/>
)}
<TitleAndBadgeContainer>
<Box
flexDirection="row"
alignItems="center"
marginRight={badgeIcon ? 'small' : 'zero'}
>
<Text.Body1 numberOfLines={1} bold>
{title}
</Text.Body1>
Expand All @@ -50,7 +55,7 @@ const Result = ({
h="small"
/>
)}
</TitleAndBadgeContainer>
</Box>
{subTitle && subTitle !== '' && (
<Text.Body2 numberOfLines={1} color="deep">
{subTitle}
Expand Down
5 changes: 0 additions & 5 deletions packages/yoga/src/Result/native/Result/styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ export const Content = styled.View`
`;
}}
`;

export const TitleAndBadgeContainer = styled(Box)`
flex-direction: row;
align-items: center;
`;

0 comments on commit ac9d3ad

Please sign in to comment.