Skip to content

Commit ba76ad6

Browse files
committed
fix(bugs): Style info pills
1 parent 25ca9d6 commit ba76ad6

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

src/common/components/pills/IconPill.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
import { Span, Tag } from '@appquality/unguess-design-system';
2-
import { theme as globalTheme } from 'src/app/theme';
32
import { ReactNode } from 'react';
43
import styled from 'styled-components';
54

5+
const StyledAvatar = styled(Tag.Avatar)``;
6+
67
const StyledTag = styled(Tag)`
78
pointer-events: none;
89
padding: 0;
910
margin-right: ${({ theme }) => theme.space.xs};
11+
${StyledAvatar} {
12+
margin-left: 0;
13+
margin-right: ${({ theme }) => theme.space.xxs};
14+
}
1015
`;
1116

1217
const StyledChild = styled(Span)`
1318
color: ${({ theme }) => theme.palette.grey[700]};
1419
`;
1520

16-
const StyledAvatar = styled(StyledTag.Avatar)`
17-
margin-left: 0 !important;
18-
margin-right: ${({ theme }) => theme.space.xxs} !important;
19-
`;
20-
2121
const PillContainer = styled.div`
2222
font-size: ${({ theme }) => theme.fontSizes.sm};
2323
margin-right: ${({ theme }) => theme.space.xs};
2424
display: flex;
2525
align-items: center;
2626
`;
27-
interface PillProps extends React.HTMLAttributes<HTMLDivElement> {
28-
title: string;
27+
28+
interface PillProps {
29+
title: ReactNode;
30+
id?: string;
31+
className?: string;
32+
style?: React.CSSProperties;
2933
background?: string;
3034
color?: string;
3135
icon?: ReactNode;
3236
children?: ReactNode;
37+
size?: Parameters<typeof Tag>[0]['size'];
3338
}
3439

3540
export const IconPill = ({
@@ -38,14 +43,13 @@ export const IconPill = ({
3843
icon,
3944
title,
4045
children,
46+
size,
4147
...props
4248
}: PillProps) => (
4349
<PillContainer {...props}>
44-
<StyledTag isPill hue={background ?? 'white'} size="large">
50+
<StyledTag isPill hue={background ?? 'white'} size={size || 'large'}>
4551
{icon && <StyledAvatar>{icon}</StyledAvatar>}
46-
<Span isBold style={{ color: color ?? globalTheme.palette.grey[700] }}>
47-
{title}
48-
</Span>
52+
{title}
4953
</StyledTag>
5054
{children && <StyledChild>{children}</StyledChild>}
5155
</PillContainer>

src/pages/Bugs/Detail/Meta.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LG, MD, SM } from '@appquality/unguess-design-system';
1+
import { LG, MD, SM, Span } from '@appquality/unguess-design-system';
22
import { ReactComponent as OSIcon } from 'src/assets/icons/environment-icon.svg';
33
import { ReactComponent as SmartphoneIcon } from 'src/assets/icons/pill-icon-smartphone.svg';
44
import { ReactComponent as TabletIcon } from 'src/assets/icons/pill-icon-tablet.svg';
@@ -21,7 +21,12 @@ const BugInfo = styled.div`
2121
justify-content: flex-start;
2222
align-items: center;
2323
flex-wrap: wrap;
24-
margin-top: ${({ theme }) => theme.space.sm};
24+
margin: ${({ theme }) => theme.space.xxs} 0;
25+
`;
26+
27+
const InfoTitle = styled(Span)`
28+
color: ${({ theme }) => theme.palette.grey[600]};
29+
font-weight: ${({ theme }) => theme.fontWeights.regular};
2530
`;
2631

2732
function getDeviceIcon(device: string) {
@@ -71,18 +76,23 @@ export default ({
7176
style={{
7277
color: globalTheme.palette.grey[600],
7378
textTransform: 'capitalize',
79+
fontWeight: globalTheme.fontWeights.regular,
7480
}}
7581
>
7682
{bug.type.name}
7783
</SM>
78-
<Pipe />
84+
<Pipe style={{ height: '20px' }} />
7985
<IconPill
80-
title={bug.device.type}
86+
size="medium"
87+
title={<InfoTitle>{bug.device.type}</InfoTitle>}
8188
icon={getDeviceIcon(bug.device.type)}
8289
style={{ textTransform: 'capitalize' }}
8390
/>
8491
<IconPill
85-
title={`${bug.device.os} ${bug.device.os_version}`}
92+
size="medium"
93+
title={
94+
<InfoTitle>{`${bug.device.os} ${bug.device.os_version}`}</InfoTitle>
95+
}
8696
icon={<OSIcon />}
8797
style={{ textTransform: 'capitalize' }}
8898
/>

0 commit comments

Comments
 (0)