Skip to content

Commit 7c8a6f7

Browse files
committed
feat(list-item): add ellipsis to list title
1 parent b3033db commit 7c8a6f7

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/pages/Campaign/widgets/List/ListItem.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
import { SM, Progress, MD, Span } from '@appquality/unguess-design-system';
1+
import {
2+
SM,
3+
Progress,
4+
MD,
5+
Span,
6+
Ellipsis,
7+
} from '@appquality/unguess-design-system';
28
import { theme as globalTheme } from 'src/app/theme';
39
import styled from 'styled-components';
410
import { ListItemProps } from './type';
511

612
const ListItemTitle = styled.div`
7-
display: flex;
8-
align-items: center;
9-
justify-content: space-between;
13+
display: grid;
14+
grid-template-columns: 9fr 1fr;
1015
padding-top: ${({ theme }) => theme.space.xs};
1116
padding-bottom: ${({ theme }) => theme.space.xxs};
1217
`;
1318

1419
const ListItemWrapper = styled.div`
1520
margin-top: ${(p) => p.theme.space.xxs};
21+
display: block;
1622
`;
1723

1824
export const ListItem = ({
@@ -22,10 +28,14 @@ export const ListItem = ({
2228
}: ListItemProps) => (
2329
<ListItemWrapper>
2430
<ListItemTitle>
25-
<MD isBold style={{ color: globalTheme.palette.blue[600] }}>
26-
{children}
31+
<MD
32+
isBold
33+
style={{ color: globalTheme.palette.blue[600], display: 'contents' }}
34+
>
35+
<Ellipsis style={{ width: '97%' }}>{children}</Ellipsis>
2736
</MD>
28-
<SM style={{ color: globalTheme.palette.grey[600] }}>
37+
38+
<SM style={{ color: globalTheme.palette.grey[600], justifySelf: 'end' }}>
2939
<Span isBold style={{ color: globalTheme.palette.grey[700] }}>
3040
{numerator}
3141
</Span>

0 commit comments

Comments
 (0)