-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1403 from thematters/develop
Release: v3.13.0
- Loading branch information
Showing
47 changed files
with
1,042 additions
and
600 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "matters-web", | ||
"version": "3.12.1", | ||
"version": "3.13.0", | ||
"description": "codebase of Matters' website", | ||
"sideEffects": false, | ||
"author": "Matters <[email protected]>", | ||
|
@@ -24,7 +24,7 @@ | |
"analyze": "BUNDLE_ANALYZE=both next build", | ||
"analyze:server": "BUNDLE_ANALYZE=server next build", | ||
"analyze:browser": "BUNDLE_ANALYZE=browser next build", | ||
"gen:type": "npm run gen:clean && apollo client:codegen __generated__ --target=typescript --includes 'src/**/*.{ts,tsx}' --endpoint 'https://server-stage.matters.news/graphql'", | ||
"gen:type": "npm run gen:clean && apollo client:codegen __generated__ --target=typescript --includes 'src/**/*.{ts,tsx}' --endpoint 'https://server-develop.matters.news/graphql'", | ||
"gen:type:prod": "npm run gen:clean && apollo client:codegen __generated__ --target=typescript --includes 'src/**/*.{ts,tsx}' --endpoint 'https://server.matters.news/graphql'", | ||
"gen:watch": "npm run gen:type -- --watch", | ||
"gen:watch:prod": "npm run gen:type:prod -- --watch", | ||
|
@@ -67,7 +67,7 @@ | |
"isomorphic-unfetch": "^3.0.0", | ||
"jump.js": "^1.0.2", | ||
"lodash": "^4.17.19", | ||
"next": "^9.4.4", | ||
"next": "^9.5.1", | ||
"next-with-apollo": "^5.1.0", | ||
"nprogress": "^0.2.0", | ||
"number-precision": "^1.5.0", | ||
|
@@ -89,7 +89,7 @@ | |
"validator": "^13.1.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "^7.10.4", | ||
"@babel/plugin-proposal-optional-chaining": "^7.11.0", | ||
"@svgr/webpack": "^5.4.0", | ||
"@testing-library/react": "^10.4.7", | ||
"@types/autosize": "^3.0.7", | ||
|
@@ -98,7 +98,7 @@ | |
"@types/fingerprintjs2": "^2.0.0", | ||
"@types/grecaptcha": "^3.0.1", | ||
"@types/helmet": "0.0.47", | ||
"@types/jest": "^26.0.7", | ||
"@types/jest": "^26.0.8", | ||
"@types/jump.js": "^1.0.3", | ||
"@types/lodash": "^4.14.158", | ||
"@types/nprogress": "0.2.0", | ||
|
@@ -144,7 +144,7 @@ | |
"styled-jsx-plugin-postcss": "^2.0.1", | ||
"stylelint": "^13.6.1", | ||
"stylelint-config-prettier": "^8.0.2", | ||
"stylelint-config-recess-order": "^2.0.4", | ||
"stylelint-config-recess-order": "^2.1.0", | ||
"stylelint-config-standard": "^20.0.0", | ||
"stylelint-prettier": "^1.1.2", | ||
"ts-jest": "^25.5.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Router from 'next/router' | ||
import { useContext, useEffect, useRef } from 'react' | ||
|
||
import { ViewerContext } from '~/components' | ||
|
||
import { analytics } from '~/common/utils' | ||
|
||
const PageViewTracker = () => { | ||
const viewer = useContext(ViewerContext) | ||
const referrer = useRef('') | ||
|
||
// first load | ||
useEffect(() => { | ||
if (!viewer.privateFetched) { | ||
return | ||
} | ||
|
||
analytics.identifyUser() | ||
analytics.trackPage() | ||
referrer.current = window.location.pathname | ||
}, [viewer.privateFetched]) | ||
|
||
// subsequent changes | ||
useEffect(() => { | ||
const trackPage = () => { | ||
if (!viewer.privateFetched) { | ||
return | ||
} | ||
|
||
analytics.trackPage('page_view', { page_referrer: referrer.current }) | ||
referrer.current = window.location.pathname | ||
} | ||
|
||
Router.events.on('routeChangeComplete', trackPage) | ||
|
||
return () => { | ||
Router.events.off('routeChangeComplete', trackPage) | ||
} | ||
}, [viewer.privateFetched]) | ||
|
||
return null | ||
} | ||
|
||
export default PageViewTracker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import { Empty, IconHashTag, Translate } from '~/components' | ||
|
||
export const EmptyTag = () => ( | ||
export const EmptyTag = ({ | ||
description, | ||
}: { | ||
description?: React.ReactNode | ||
}) => ( | ||
<Empty | ||
icon={<IconHashTag size="xxl" />} | ||
description={<Translate id="TAG_NOT_FOUND" />} | ||
description={description || <Translate id="TAG_NOT_FOUND" />} | ||
/> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.