Skip to content

Commit

Permalink
Merge pull request #2845 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v4.7.0
  • Loading branch information
robertu7 authored Oct 20, 2022
2 parents e86b196 + 91c9416 commit e524178
Show file tree
Hide file tree
Showing 61 changed files with 30,351 additions and 35,530 deletions.
2 changes: 2 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ NEXT_PUBLIC_PROGRAMMABLE_SEARCH_ENGINE_ID=004538121411474993797:xkl3sdy-9su
NEXT_PUBLIC_TRAVELOGGERS_URL=https://nft-develop.matters.news
NEXT_PUBLIC_LOGBOOKS_URL=https://logbooks-vercel.matters.news
NEXT_PUBLIC_ALCHEMY_KEY=1dMo8xjAFo8M6Y4sQ45WTD3Zie2-MA4C
NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1
NEXT_PUBLIC_CURATION_CONTRACT_ADDRESS=0xa219c6722008aa22828b31a13ab9ba93bb91222c
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ NEXT_PUBLIC_PROGRAMMABLE_SEARCH_ENGINE_ID=004538121411474993797:xkl3sdy-9su
NEXT_PUBLIC_TRAVELOGGERS_URL=https://nft-develop.matters.news
NEXT_PUBLIC_LOGBOOKS_URL=https://logbooks-vercel.matters.news
NEXT_PUBLIC_ALCHEMY_KEY=1dMo8xjAFo8M6Y4sQ45WTD3Zie2-MA4C
NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1
NEXT_PUBLIC_CURATION_CONTRACT_ADDRESS=0xa219c6722008aa22828b31a13ab9ba93bb91222c
2 changes: 2 additions & 0 deletions .env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ NEXT_PUBLIC_PROGRAMMABLE_SEARCH_ENGINE_ID=004538121411474993797:xkl3sdy-9su
NEXT_PUBLIC_TRAVELOGGERS_URL=https://traveloggers.matters.news
NEXT_PUBLIC_LOGBOOKS_URL=https://logbook.matters.news
NEXT_PUBLIC_ALCHEMY_KEY=bOu-fCphi9mvePsxg968Qe-pidHQNdlT
NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xc2132D05D31c914a87C6611C10748AEb04B58e8F
NEXT_PUBLIC_CURATION_CONTRACT_ADDRESS=0x5edebbdae7b5c79a69aacf7873796bb1ec664db8
63,859 changes: 28,582 additions & 35,277 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matters-web",
"version": "4.6.0",
"version": "4.7.0",
"description": "codebase of Matters' website",
"sideEffects": false,
"author": "Matters <[email protected]>",
Expand Down Expand Up @@ -108,7 +108,7 @@
"subscriptions-transport-ws": "^0.10.0",
"use-debounce": "^7.0.1",
"validator": "^13.7.0",
"wagmi": "^0.4.11"
"wagmi": "^0.7.4"
},
"devDependencies": {
"@apollo/react-testing": "^3.1.3",
Expand Down
11 changes: 11 additions & 0 deletions public/static/icons/40px/usdt-active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/static/icons/40px/usdt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/common/enums/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const CONNECT_SRC = [

// Alchemy
'*.alchemyapi.io',
'*.alchemy.com',

// IPFS Gateways
'ipfs.io/ipfs/',
Expand Down
59 changes: 59 additions & 0 deletions src/common/enums/externalLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,62 @@ export const EXTERNAL_LINKS = {
'https://docs.like.co/v/zh/user-guide/likecoin-button/superlike?utm_source=Matters&utm_medium=website&utm_campaign=superlike_funnel',
PLANET: 'https://www.planetable.xyz/',
}

export const GUIDE_LINKS = {
readerToolbox: {
zh_hant:
'https://matters.news/@hi176/255829-matters-%E8%AE%80%E8%80%85%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2022-03-%E6%9B%B4%E6%96%B0-bafyreibgaprnoj2yqeaiaox6tzl74id3yrxyynodthfby6m4fzqqzrmiym',
zh_hans:
'https://matters.news/zh-Hans/@hi176/255829-matters-%E8%AE%80%E8%80%85%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2022-03-%E6%9B%B4%E6%96%B0-bafyreibgaprnoj2yqeaiaox6tzl74id3yrxyynodthfby6m4fzqqzrmiym',
en: 'https://matters.news/en/@hi176/255829-matters-%E8%AE%80%E8%80%85%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2022-03-%E6%9B%B4%E6%96%B0-bafyreibgaprnoj2yqeaiaox6tzl74id3yrxyynodthfby6m4fzqqzrmiym',
},
authorToolbox: {
zh_hant:
'https://matters.news/@hi176/255830-matters-%E4%BD%9C%E8%80%85%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2022-03-%E6%9B%B4%E6%96%B0-bafyreierks3n7n7aohc7to26wn7vgohspcxprxlakvdjt4g4ex74qqxuci',
zh_hans:
'https://matters.news/zh-Hans/@hi176/255830-matters-%E4%BD%9C%E8%80%85%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2022-03-%E6%9B%B4%E6%96%B0-bafyreierks3n7n7aohc7to26wn7vgohspcxprxlakvdjt4g4ex74qqxuci',
en: 'https://matters.news/en/@hi176/255830-matters-%E4%BD%9C%E8%80%85%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2022-03-%E6%9B%B4%E6%96%B0-bafyreierks3n7n7aohc7to26wn7vgohspcxprxlakvdjt4g4ex74qqxuci',
},
connectWallet: {
zh_hant:
'https://matters.news/@hi176/340008-matters-%E5%8A%A0%E5%AF%86%E9%8C%A2%E5%8C%85%E6%8C%87%E5%8D%97-2022-10-%E6%9B%B4%E6%96%B0-bafyreibjlc7znkrl5ljk7cwa2htagm6uhzdupbc37clgxelh6nkpvfqdtu',
zh_hans:
'https://matters.news/zh-Hans/@hi176/340008-matters-%E5%8A%A0%E5%AF%86%E9%8C%A2%E5%8C%85%E6%8C%87%E5%8D%97-2022-10-%E6%9B%B4%E6%96%B0-bafyreibjlc7znkrl5ljk7cwa2htagm6uhzdupbc37clgxelh6nkpvfqdtu',
en: 'https://matters.news/en/@hi176/340008-matters-%E5%8A%A0%E5%AF%86%E9%8C%A2%E5%8C%85%E6%8C%87%E5%8D%97-2022-10-%E6%9B%B4%E6%96%B0-bafyreibjlc7znkrl5ljk7cwa2htagm6uhzdupbc37clgxelh6nkpvfqdtu',
},
payment: {
zh_hant:
'https://matters.news/@hi176/340009-matters-%E6%94%AF%E4%BB%98%E8%88%87%E6%8F%90%E7%8F%BE%E6%8C%87%E5%8D%97-2022-10-%E6%9B%B4%E6%96%B0-bafyreihtziqrqalppvjcnjxno4vwwiuate75jmefomrziyv64jiaje62mi',
zh_hans:
'https://matters.news/zh-Hans/@hi176/340009-matters-%E6%94%AF%E4%BB%98%E8%88%87%E6%8F%90%E7%8F%BE%E6%8C%87%E5%8D%97-2022-10-%E6%9B%B4%E6%96%B0-bafyreihtziqrqalppvjcnjxno4vwwiuate75jmefomrziyv64jiaje62mi',
en: 'https://matters.news/en/@hi176/340009-matters-%E6%94%AF%E4%BB%98%E8%88%87%E6%8F%90%E7%8F%BE%E6%8C%87%E5%8D%97-2022-10-%E6%9B%B4%E6%96%B0-bafyreihtziqrqalppvjcnjxno4vwwiuate75jmefomrziyv64jiaje62mi',
},
tagUsage: {
zh_hant:
'https://matters.news/@hi176/59632-matters-%E6%A8%99%E7%B1%A4%E5%8A%9F%E8%83%BD%E5%A4%A7%E9%80%B2%E5%8C%96-%E9%96%B1%E8%AE%80%E5%88%86%E9%A1%9E-%E5%80%8B%E4%BA%BA%E5%B0%88%E6%AC%84-%E5%AE%83%E9%83%BD%E8%83%BD%E6%BB%BF%E8%B6%B3%E4%BD%A0-bafyreifdlhuy33h6235jt5vk2k7fyxendykkhgixfvnzr6izu4677xtwui',
zh_hans:
'https://matters.news/zh-Hans/@hi176/59632-matters-%E6%A8%99%E7%B1%A4%E5%8A%9F%E8%83%BD%E5%A4%A7%E9%80%B2%E5%8C%96-%E9%96%B1%E8%AE%80%E5%88%86%E9%A1%9E-%E5%80%8B%E4%BA%BA%E5%B0%88%E6%AC%84-%E5%AE%83%E9%83%BD%E8%83%BD%E6%BB%BF%E8%B6%B3%E4%BD%A0-bafyreifdlhuy33h6235jt5vk2k7fyxendykkhgixfvnzr6izu4677xtwui',
en: 'https://matters.news/en/@hi176/59632-matters-%E6%A8%99%E7%B1%A4%E5%8A%9F%E8%83%BD%E5%A4%A7%E9%80%B2%E5%8C%96-%E9%96%B1%E8%AE%80%E5%88%86%E9%A1%9E-%E5%80%8B%E4%BA%BA%E5%B0%88%E6%AC%84-%E5%AE%83%E9%83%BD%E8%83%BD%E6%BB%BF%E8%B6%B3%E4%BD%A0-bafyreifdlhuy33h6235jt5vk2k7fyxendykkhgixfvnzr6izu4677xtwui',
},
circleUsage: {
zh_hant:
'https://matters.news/@hi176/161255-%E5%9C%8D%E7%88%90%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2021-07-30%E6%9B%B4%E6%96%B0-bafyreiccncpjoyj7jhiheljwpbwsz33wvfqyyxc6vuhf5xtb4mvpooevfy',
zh_hans:
'https://matters.news/zh-Hans/@hi176/161255-%E5%9C%8D%E7%88%90%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2021-07-30%E6%9B%B4%E6%96%B0-bafyreiccncpjoyj7jhiheljwpbwsz33wvfqyyxc6vuhf5xtb4mvpooevfy',
en: 'https://matters.news/en/@hi176/161255-%E5%9C%8D%E7%88%90%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97-%E6%96%B0%E6%89%8B%E5%BF%85%E7%9C%8B-2021-07-30%E6%9B%B4%E6%96%B0-bafyreiccncpjoyj7jhiheljwpbwsz33wvfqyyxc6vuhf5xtb4mvpooevfy',
},
PWA: {
zh_hant:
'https://matters.news/zh-Hant/@1ampa55ag3/24439-guidance-%E5%A6%82%E4%BD%95%E8%AE%A9%E4%BD%A0%E7%9A%84matters%E4%B9%8B%E6%97%85%E6%9B%B4%E4%BE%BF%E6%8D%B7-bafyreiayiuxi4qc2a7qpgjp3fe42wmaoppqykckcvtq4hiukl5pgs3dn2m',
zh_hans:
'https://matters.news/@1ampa55ag3/24439-guidance-%E5%A6%82%E4%BD%95%E8%AE%A9%E4%BD%A0%E7%9A%84matters%E4%B9%8B%E6%97%85%E6%9B%B4%E4%BE%BF%E6%8D%B7-bafyreiayiuxi4qc2a7qpgjp3fe42wmaoppqykckcvtq4hiukl5pgs3dn2m',
en: 'https://matters.news/en/@1ampa55ag3/24439-guidance-%E5%A6%82%E4%BD%95%E8%AE%A9%E4%BD%A0%E7%9A%84matters%E4%B9%8B%E6%97%85%E6%9B%B4%E4%BE%BF%E6%8D%B7-bafyreiayiuxi4qc2a7qpgjp3fe42wmaoppqykckcvtq4hiukl5pgs3dn2m',
},
RSS: {
zh_hant:
'https://matters.news/@hi176/338013-%E5%8A%9F%E8%83%BD%E6%8C%87%E5%8D%97-%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8-%E5%85%A7%E5%AE%B9%E8%A8%82%E9%96%B1-%E4%BE%86%E8%BF%BD%E8%B9%A4%E4%BD%A0%E5%96%9C%E6%84%9B%E7%9A%84-matters-%E4%BD%9C%E8%80%85-bafyreidb42pruxqy75tybjarp6kebmf7quyn3etd6mtv7fopwve6a7mjaa',
zh_hans:
'https://matters.news/zh-Hans/@hi176/338013-%E5%8A%9F%E8%83%BD%E6%8C%87%E5%8D%97-%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8-%E5%85%A7%E5%AE%B9%E8%A8%82%E9%96%B1-%E4%BE%86%E8%BF%BD%E8%B9%A4%E4%BD%A0%E5%96%9C%E6%84%9B%E7%9A%84-matters-%E4%BD%9C%E8%80%85-bafyreidb42pruxqy75tybjarp6kebmf7quyn3etd6mtv7fopwve6a7mjaa',
en: 'https://matters.news/en/@hi176/338013-%E5%8A%9F%E8%83%BD%E6%8C%87%E5%8D%97-%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8-%E5%85%A7%E5%AE%B9%E8%A8%82%E9%96%B1-%E4%BE%86%E8%BF%BD%E8%B9%A4%E4%BD%A0%E5%96%9C%E6%84%9B%E7%9A%84-matters-%E4%BD%9C%E8%80%85-bafyreidb42pruxqy75tybjarp6kebmf7quyn3etd6mtv7fopwve6a7mjaa',
},
}
5 changes: 5 additions & 0 deletions src/common/enums/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export enum PAYMENT_MAXIMUM_CIRCLE_AMOUNT {
export enum PAYMENT_CURRENCY {
HKD = 'HKD',
LIKE = 'LIKE',
USDT = 'USDT',
}

export enum CHAIN {
POLYGON = 'Polygon',
}

export const PLATFORM_FEE = {
Expand Down
74 changes: 74 additions & 0 deletions src/common/utils/contract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
export const curationABI = [
{ inputs: [], name: 'InvalidURI', type: 'error' },
{ inputs: [], name: 'SelfCuration', type: 'error' },
{ inputs: [], name: 'TransferFailed', type: 'error' },
{ inputs: [], name: 'ZeroAddress', type: 'error' },
{ inputs: [], name: 'ZeroAmount', type: 'error' },
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'from', type: 'address' },
{ indexed: true, internalType: 'address', name: 'to', type: 'address' },
{
indexed: true,
internalType: 'contract IERC20',
name: 'token',
type: 'address',
},
{ indexed: false, internalType: 'string', name: 'uri', type: 'string' },
{
indexed: false,
internalType: 'uint256',
name: 'amount',
type: 'uint256',
},
],
name: 'Curation',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'from', type: 'address' },
{ indexed: true, internalType: 'address', name: 'to', type: 'address' },
{ indexed: false, internalType: 'string', name: 'uri', type: 'string' },
{
indexed: false,
internalType: 'uint256',
name: 'amount',
type: 'uint256',
},
],
name: 'Curation',
type: 'event',
},
{
inputs: [
{ internalType: 'address', name: 'to_', type: 'address' },
{ internalType: 'contract IERC20', name: 'token_', type: 'address' },
{ internalType: 'uint256', name: 'amount_', type: 'uint256' },
{ internalType: 'string', name: 'uri_', type: 'string' },
],
name: 'curate',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'to_', type: 'address' },
{ internalType: 'string', name: 'uri_', type: 'string' },
],
name: 'curate',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [{ internalType: 'bytes4', name: 'interfaceId_', type: 'bytes4' }],
name: 'supportsInterface',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
] as const
1 change: 1 addition & 0 deletions src/common/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export * from './storage'
export * from './wallet'
export * from './globalId'
export * from './iscnLink'
export * from './contract'
10 changes: 6 additions & 4 deletions src/common/utils/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { providers } from 'ethers'
import { configureChains, defaultChains } from 'wagmi'
import { chain, configureChains } from 'wagmi'
import { alchemyProvider } from 'wagmi/providers/alchemy'
import { publicProvider } from 'wagmi/providers/public'

import { WalletErrorType } from '~/common/enums'

// const isProd = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'production'
const isProd = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'production'

export const supportedChains = isProd ? [chain.polygon] : [chain.polygonMumbai]

const alchemyId = process.env.NEXT_PUBLIC_ALCHEMY_KEY || ''

export const { chains } = configureChains(defaultChains, [
alchemyProvider({ alchemyId }),
export const { chains } = configureChains(supportedChains, [
alchemyProvider({ apiKey: alchemyId }),
publicProvider(),
])

Expand Down
16 changes: 8 additions & 8 deletions src/components/CurrencyFormatter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import styles from './styles.css'

interface Props {
currency: number
currencyCode: string
subCurrency?: number
subCurrencyCode?: string
value: number | string
currency: string
subValue?: number | string
subCurrency?: string
}

export const CurrencyFormatter: React.FC<Props> = ({
value,
currency,
currencyCode,
subValue,
subCurrency,
subCurrencyCode,
}) => {
return (
<span className="currencyFormatter">
<span className="currency">
{currencyCode}&nbsp;{currency}
{currency}&nbsp;{value}
</span>
{subCurrency && (
<span className="subCurrency">
≈&nbsp;{subCurrencyCode}&nbsp;{subCurrency}
≈&nbsp;{subCurrency}&nbsp;{subValue}
</span>
)}
<style jsx>{styles}</style>
Expand Down
Loading

0 comments on commit e524178

Please sign in to comment.