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

Vertically align tag component on overview #4046

Merged
merged 1 commit into from
Jul 16, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions app/components/Tags/Tag.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
min(calc((var(--perceived-lightness) - var(--border-threshold)) * 100), 1)
);

display: flex;
color: hsl(0deg, 0%, calc(var(--lightness-switch) * 100%));
background: rgb(var(--label-r), var(--label-g), var(--label-b));
border-color: hsla(
Expand Down
1 change: 1 addition & 0 deletions app/routes/articles/components/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const OverviewItem = ({
))}

<Time time={article.createdAt} format="DD.MM.YYYY HH:mm" />

<Tags className={styles.tagline}>
{article.tags.map((tag) => (
<Tag tag={tag} key={tag} />
Expand Down
13 changes: 5 additions & 8 deletions app/routes/overview/components/Overview.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,17 @@
padding: 28px 0 0;
}

.itemInfo {
color: var(--secondary-font-color);
.dot {
margin: 0 6px;
}

.type {
margin-right: 4px;
margin-right: 6px;
}

.tagline {
display: inline-block;
white-space: nowrap;
transform: translateY(-7.5%);
vertical-align: middle;
overflow: hidden;
margin: 0;
display: inline-flex;
}

.otherItems {
Expand Down
4 changes: 3 additions & 1 deletion app/routes/overview/components/Pinned.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

.pinnedHeading {
padding: 15px;
align-items: center;
display: flex;
flex-direction: column;
align-items: flex-start;
}

.itemTitle {
Expand Down
22 changes: 14 additions & 8 deletions app/routes/overview/components/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import moment from 'moment-timezone';
import Flex from 'app/components/Layout/Flex';
import Tags from 'app/components/Tags';
import Tag from 'app/components/Tags/Tag';
import Time from 'app/components/Time';
Expand Down Expand Up @@ -34,19 +35,24 @@ export const renderMeta = (
}

return (
<span className={styles.itemInfo}>
<Flex
wrap
alignItems="center"
justifyContent="center"
className="secondaryFontColor"
>
<Time time={itemTime} format={format} />

{isEvent(item) && item.location !== '-' && (
<span>
<span> • </span>
<>
<span className={styles.dot}> • </span>
<span> {truncateString(item.location, 8)} </span>
</span>
</>
)}

<span> • </span>
<span className={styles.dot}> • </span>
<span className={styles.type}>
{' '}
{isEvent(item) ? eventTypeToString(item.eventType) : 'Artikkel'}{' '}
{isEvent(item) ? eventTypeToString(item.eventType) : 'Artikkel'}
</span>

{item.tags?.length > 0 && (
Expand All @@ -56,6 +62,6 @@ export const renderMeta = (
))}
</Tags>
)}
</span>
</Flex>
);
};