Skip to content

Commit 54d09d8

Browse files
authored
Merge pull request #5778 from thematters/develop
Release: v6.3.3
2 parents d7743a5 + 662427b commit 54d09d8

File tree

22 files changed

+132
-15
lines changed

22 files changed

+132
-15
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matters-web",
3-
"version": "6.3.2",
3+
"version": "6.3.3",
44
"description": "codebase of Matters' website",
55
"author": "Matters <hi@matters.town>",
66
"engines": {

src/common/enums/channel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ const isProd = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'production'
77
export const FEATUED_CHANNEL_SHORT_HASH = isProd
88
? 'zlkqtdykun21'
99
: 'zctb1wb9s2vn'
10+
export const CREATIONS_CHANNEL_SHORT_HASH = isProd
11+
? '1ptnue2cleq4'
12+
: 'r09vjix6reha'

src/common/styles/variables/colors.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@
7676
--color-new-palette-attention-600: #ddc700;
7777
--color-new-palette-attention-700: #cab600;
7878
--color-new-palette-secondary-700: #379f03;
79+
--color-new-palette-primary-500: #9280f5;
7980
}

src/common/styles/variables/spacing.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
--sp30: 1.875rem; /* 30px */
1717
--sp32: 2rem; /* 32px */
1818
--sp40: 2.5rem; /* 40px */
19+
--sp44: 2.75rem; /* 44px */
1920
--sp48: 3rem; /* 48px */
2021
--sp64: 4rem; /* 64px */
2122
--ar17-100: 0.93125rem; /* 14.9px */

src/components/Announcements/Carousel/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
height: 0.125rem;
104104
margin-right: var(--sp8);
105105
cursor: pointer;
106-
background: var(--color-grey-darker);
106+
background: var(--color-grey-scale-white-60);
107107
border: 1px solid rgb(255 255 255 / 0%);
108108
border-radius: 1px;
109109
transition-property: border-color, border-width, background-color;

src/components/ArticleDigest/Feed/FooterActions/gql.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ export const fragments = {
2828
...DigestTitleCircle
2929
}
3030
}
31+
collections(input: { first: null }) {
32+
edges {
33+
node {
34+
id
35+
title
36+
articles(input: { first: 0 }) {
37+
totalCount
38+
}
39+
}
40+
}
41+
}
3142
campaigns {
3243
campaign {
3344
id

src/components/ArticleDigest/Feed/FooterActions/index.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Link from 'next/link'
22
import { useContext } from 'react'
33
import { FormattedMessage } from 'react-intl'
44

5+
import IconBook2 from '@/public/static/icons/24px/book2.svg'
56
import IconPaywall from '@/public/static/icons/24px/paywall.svg'
67
import IconStar from '@/public/static/icons/24px/star.svg'
78
import { toPath } from '~/common/utils'
@@ -29,6 +30,7 @@ export type FooterActionsProps = {
2930
hasDonationCount?: boolean
3031
hasCircle?: boolean
3132
hasCampaign?: boolean
33+
hasCollection?: boolean
3234
tag?: React.ReactNode
3335
includesMetaData?: boolean
3436
} & FooterActionsControls
@@ -40,6 +42,7 @@ const FooterActions = ({
4042
hasDonationCount,
4143
hasCircle,
4244
hasCampaign = true,
45+
hasCollection = false,
4346
tag,
4447
includesMetaData = true,
4548
...controls
@@ -50,6 +53,18 @@ const FooterActions = ({
5053
const viewer = useContext(ViewerContext)
5154
const { lang } = useContext(LanguageContext)
5255
const { channelId, pinned, hasTogglePinChannelArticles } = controls
56+
const collection = article.collections.edges
57+
?.map((edge) => edge.node)
58+
.reduce(
59+
(maxCollection, currentCollection) => {
60+
if (!maxCollection) return currentCollection
61+
return currentCollection.articles.totalCount >
62+
maxCollection.articles.totalCount
63+
? currentCollection
64+
: maxCollection
65+
},
66+
null as (typeof article.collections.edges)[0]['node'] | null
67+
)
5368

5469
return (
5570
<footer className={styles.footer}>
@@ -112,6 +127,25 @@ const FooterActions = ({
112127
}
113128
</Link>
114129
)}
130+
131+
{hasCollection && collection && article.author.userName && (
132+
<Link
133+
{...toPath({
134+
page: 'collectionDetail',
135+
userName: article.author.userName,
136+
collection,
137+
})}
138+
className={styles.collection}
139+
>
140+
<TextIcon
141+
icon={<Icon icon={IconBook2} size={12} />}
142+
size={12}
143+
color="newPalettePrimary500"
144+
>
145+
{collection.title}
146+
</TextIcon>
147+
</Link>
148+
)}
115149
</>
116150
)}
117151
</section>

src/components/Layout/SideChannelNav/ChannelItem.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ const ChannelItem = ({ channel }: ChannelItemProps) => {
3434
const isWritingChallenge = channel.__typename === 'WritingChallenge'
3535
const isCurationChannel = channel.__typename === 'CurationChannel'
3636

37+
const innerClassName = classnames({
38+
[styles.inner]: true,
39+
[styles.threeLines]: isWritingChallenge || isCurationChannel,
40+
})
41+
3742
const pathType = isWritingChallenge
3843
? CHANNEL_PATH_TYPES.WRITING_CHALLENGE
3944
: CHANNEL_PATH_TYPES.REGULAR_CHANNEL
@@ -71,7 +76,7 @@ const ChannelItem = ({ channel }: ChannelItemProps) => {
7176
}}
7277
>
7378
<span className={styles.name}>
74-
<span className={styles.inner}>{channelName}</span>
79+
<span className={innerClassName}>{channelName}</span>
7580
</span>
7681
</Link>
7782
</Tooltip>

src/components/Layout/SideChannelNav/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
@mixin line-clamp;
129129

130130
-webkit-line-clamp: 2;
131+
132+
&.threeLines {
133+
-webkit-line-clamp: 3;
134+
}
131135
}
132136

133137
@media (--xs-up) {

0 commit comments

Comments
 (0)