Skip to content

Commit

Permalink
Merge pull request #3489 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v4.22.1
  • Loading branch information
robertu7 authored May 26, 2023
2 parents 75bf739 + f53bce8 commit e088b51
Show file tree
Hide file tree
Showing 24 changed files with 104 additions and 246 deletions.
16 changes: 4 additions & 12 deletions lang/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
"defaultMessage": "Next Step",
"description": ""
},
"8w3GEA": {
"defaultMessage": "mentioned you in {article}",
"description": "src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
},
"8xPi0N": {
"defaultMessage": "Unsubscribe Circle",
"description": "src/views/Circle/Profile/DropdownActions/index.tsx"
Expand Down Expand Up @@ -567,10 +571,6 @@
"defaultMessage": "The original login via email will be kept for you. Please note that your wallet cannot be reset once it is connected because of your account security.",
"description": "src/components/Forms/WalletAuthForm/Select.tsx"
},
"UgvfcU": {
"defaultMessage": "You have successfully completed Ethereum wallet settings. Please confirm wallet address:",
"description": "src/components/Notice/CryptoNotice/CryptoWalletConnectedNotice.tsx"
},
"UjKkhq": {
"defaultMessage": "Tags added",
"description": "src/views/TagDetail/DropdownActions/index.tsx"
Expand Down Expand Up @@ -1007,10 +1007,6 @@
"defaultMessage": "Circle Name",
"description": ""
},
"qQmSxu": {
"defaultMessage": "Airdrop registration completed. Your NFT will be revealed on November 12. Confirm your ETH wallet address:",
"description": "src/components/Notice/CryptoNotice/CryptoWalletAirdropNotice.tsx"
},
"qYzBk8": {
"defaultMessage": "unsubscribed your circle",
"description": "src/components/Notice/CircleNotice/CircleNewUserNotice.tsx"
Expand Down Expand Up @@ -1063,10 +1059,6 @@
"defaultMessage": "Log in",
"description": "src/components/Buttons/Login/index.tsx"
},
"sncOwi": {
"defaultMessage": "mentioned you in an article",
"description": "src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
},
"stjoBH": {
"defaultMessage": "Now, go like the authors you support! Your Likes will become their income",
"description": "src/components/Forms/EmailSignUpForm/Complete.tsx"
Expand Down
6 changes: 3 additions & 3 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@
"defaultMessage": "Your work {articleTitle} has been published to decentralized network",
"description": "src/components/Notice/ArticleNotice/ArticlePublishedNotice.tsx"
},
"sncOwi": {
"defaultMessage": " mentioned you in an article",
"8w3GEA": {
"defaultMessage": "mentioned you in {article}",
"description": "src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
},
"CD688y": {
Expand All @@ -435,7 +435,7 @@
"defaultMessage": "etc. {actorsCount} users",
"description": "src/components/Notice/ArticleNotice/ArticleNewSubscriberNotice.tsx"
},
"PjT72J": {
"p5qZnJ": {
"defaultMessage": "liked",
"description": "src/components/Notice/ArticleNotice/ArticleNewAppreciationNotice.tsx"
},
Expand Down
4 changes: 2 additions & 2 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,8 @@
"defaultMessage": "登入",
"description": "src/components/Buttons/Login/index.tsx"
},
"sncOwi": {
"defaultMessage": " 在作品中提及你",
"8w3GEA": {
"defaultMessage": "在作品 {article} 中提及你",
"description": "src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
},
"stjoBH": {
Expand Down
4 changes: 2 additions & 2 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -1111,8 +1111,8 @@
"defaultMessage": "登录",
"description": "src/components/Buttons/Login/index.tsx"
},
"sncOwi": {
"defaultMessage": " 在作品中提及你",
"8w3GEA": {
"defaultMessage": "在作品 {article} 中提及你",
"description": "src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
},
"stjoBH": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matters-web",
"version": "4.22.0",
"version": "4.22.1",
"description": "codebase of Matters' website",
"sideEffects": false,
"author": "Matters <[email protected]>",
Expand Down
1 change: 0 additions & 1 deletion src/common/gql/fragmentTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
{ "name": "TagNotice" },
{ "name": "TransactionNotice" },
{ "name": "CircleNotice" },
{ "name": "CryptoNotice" },
{ "name": "OfficialAnnouncementNotice" }
]
},
Expand Down
8 changes: 4 additions & 4 deletions src/common/styles/variables/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
:root {
/* Font Stack */
--font-sans-tc: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
'Segoe UI', roboto, arial, 'PingFang TC', 'Microsoft YaHei',
'Source Han Sans TC', 'Noto Sans CJK TC', 'WenQuanYi Micro Hei', sans-serif;
'Segoe UI', roboto, arial, 'PingFang TC', 'Source Han Sans TC',
'Noto Sans CJK TC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
--font-sans-sc: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
'Segoe UI', roboto, arial, 'PingFang SC', 'Microsoft YaHei',
'Source Han Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', sans-serif;
'Segoe UI', roboto, arial, 'PingFang SC', 'Source Han Sans SC',
'Noto Sans CJK SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
--font-serif-tc: 'Noto Serif', 'Noto Serif CJK TC', 'Source Han Serif TC',
'Songti TC', serif;
--font-serif-sc: 'Noto Serif', 'Noto Serif CJK SC', 'Source Han Serif SC',
Expand Down
13 changes: 11 additions & 2 deletions src/components/DateTime/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classNames from 'classnames'
import React, { useContext } from 'react'

import { datetimeFormat } from '~/common/utils'
Expand All @@ -7,6 +8,7 @@ import styles from './styles.css'

interface DateTimeProps {
date: Date | string | number
color?: 'grey' | 'grey-dark'
type?: 'absolute' | 'relative' | 'standard'
}

Expand All @@ -26,11 +28,18 @@ interface DateTimeProps {
* ```
*/

const BaseDateTime = ({ date, type = 'absolute' }: DateTimeProps) => {
const BaseDateTime = ({
date,
type = 'absolute',
color = 'grey-dark',
}: DateTimeProps) => {
const { lang } = useContext(LanguageContext)
const timeclasses = classNames({
[color || '']: !!color,
})

return (
<time dateTime={new Date(date).toISOString()}>
<time dateTime={new Date(date).toISOString()} className={timeclasses}>
{datetimeFormat[type](date, lang)}

<style jsx>{styles}</style>
Expand Down
8 changes: 8 additions & 0 deletions src/components/DateTime/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ time {
color: var(--color-grey-dark);
white-space: nowrap;
}

.grey {
color: var(--color-grey);
}

.grey-dark {
color: var(--color-grey-dark);
}
8 changes: 5 additions & 3 deletions src/components/Head/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Head: React.FC<HeadProps> = (props) => {
? `${props.keywords.join(',')},matters,${
process.env.NEXT_PUBLIC_SITE_DOMAIN
},創作有價`
: 'matters,${process.env.NEXT_PUBLIC_SITE_DOMAIN},創作有價',
: `matters,${process.env.NEXT_PUBLIC_SITE_DOMAIN},創作有價`,
url: props.path
? `https://${siteDomain}${props.path}`
: `https://${siteDomain}${router.asPath || '/'}`,
Expand All @@ -66,7 +66,7 @@ export const Head: React.FC<HeadProps> = (props) => {
props.jsonLdData.description = head.description
}

const canonicalUrl = head.url?.split('?')[0]
const canonicalUrl = head.url?.split('#')[0].split('?')[0]

return (
<NextHead>
Expand Down Expand Up @@ -107,7 +107,9 @@ export const Head: React.FC<HeadProps> = (props) => {
type="application/opensearchdescription+xml"
key="opensearch"
/>
<link rel="canonical" href={canonicalUrl} key="canonical" />
{props.path && (
<link rel="canonical" href={canonicalUrl} key="canonical" />
)}
{props.paymentPointer && (
<meta name="monetization" content={props.paymentPointer} />
)}
Expand Down
47 changes: 15 additions & 32 deletions src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,29 @@ import { ArticleMentionedYouNoticeFragment } from '~/gql/graphql'
import NoticeActorAvatar from '../NoticeActorAvatar'
import NoticeActorName from '../NoticeActorName'
import NoticeArticleCard from '../NoticeArticleCard'
import NoticeArticleTitle from '../NoticeArticleTitle'
import NoticeDate from '../NoticeDate'
import NoticeHead from '../NoticeHead'
import styles from '../styles.css'
import NoticeDigest from '../NoticeDigest'

const ArticleMentionedYouNotice = ({
notice,
}: {
notice: ArticleMentionedYouNoticeFragment
}) => {
if (!notice.actors) {
return null
}

const actor = notice.actors[0]

return (
<section
className="container"
data-test-id={TEST_ID.NOTICE_ARTICLE_MENTIONED_YOU}
>
<section className="avatar-wrap">
<NoticeActorAvatar user={actor} />
</section>

<section className="content-wrap">
<NoticeHead>
<NoticeActorName user={actor} />
<FormattedMessage
defaultMessage="mentioned you in an article"
description="src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
/>
</NoticeHead>

<NoticeArticleCard article={notice.article} />

<NoticeDate notice={notice} />
</section>

<style jsx>{styles}</style>
</section>
<NoticeDigest
notice={notice}
action={
<FormattedMessage
defaultMessage="mentioned you in {article}"
description="src/components/Notice/ArticleNotice/ArticleMentionedYouNotice.tsx"
values={{
article: <NoticeArticleTitle article={notice.article} />,
}}
/>
}
testId={TEST_ID.NOTICE_ARTICLE_MENTIONED_YOU}
/>
)
}

Expand Down
56 changes: 0 additions & 56 deletions src/components/Notice/CryptoNotice/CryptoWalletAirdropNotice.tsx

This file was deleted.

56 changes: 0 additions & 56 deletions src/components/Notice/CryptoNotice/CryptoWalletConnectedNotice.tsx

This file was deleted.

Loading

0 comments on commit e088b51

Please sign in to comment.