Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [EXUX-912] Add extra margin to result title and badge container #822

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
`;
Loading