Skip to content

Commit 6934f44

Browse files
author
Ives van Hoorne
committed
Align tags in search to right
1 parent 3df6b06 commit 6934f44

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/app/components/sandbox/Tags/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ const TagContainer = styled.div`
1111
display: flex;
1212
flex-direction: row;
1313
flex-wrap: wrap;
14+
${props => props.align === 'right' && `justify-content: flex-end;`};
1415
`;
1516

1617
type Props = {
18+
align: 'right' | 'left',
1719
tags: Array<string>,
1820
removeTag: ?(id: string, tag: string) => void,
1921
};
2022

21-
export default ({ tags, removeTag, ...props }: Props) =>
22-
<TagContainer {...props}>
23+
export default ({ tags, removeTag, align, ...props }: Props) =>
24+
<TagContainer align={align || 'left'} {...props}>
2325
{tags.sort().map(tag =>
2426
<Margin key={tag} vertical={0.5} horizontal={0.25}>
2527
<Tag removeTag={removeTag} tag={tag} />

src/app/pages/Search/SandboxCard/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const Description = styled.p`
5656

5757
const TagContainer = styled.div`
5858
font-size: .75rem;
59-
max-width: 30%;
59+
width: 30%;
6060
`;
6161

6262
type Props = {
@@ -93,6 +93,7 @@ export default ({ hit }: Props) =>
9393
</Title>
9494
<TagContainer>
9595
<Tags
96+
align="right"
9697
style={{ margin: 0, marginTop: -2 }}
9798
tags={(hit.tags || []).filter(tag => tag.length < 20)}
9899
/>

0 commit comments

Comments
 (0)