Skip to content

Commit 705ddbd

Browse files
authored
Remove Matomo tracking script (#277)
* Update dependencies * Update dependencies * Remove Matomo tracking script
1 parent 1679536 commit 705ddbd

11 files changed

+653
-719
lines changed

components/Code.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const CodeBlock = ({ children, ...props }: CodeBlockProps) => {
109109
children as {
110110
props: {
111111
children: string
112-
className: string
112+
className?: string
113113
}
114114
}
115115
).props

components/DocSearch.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DocSearchModal, DocSearchProps, useDocSearchKeyboardEvents } from '@doc
22
import { Global } from '@emotion/react'
33
import { useCallback, useRef, useState } from 'react'
44
import { createPortal } from 'react-dom'
5+
import { Theme } from 'theme-ui'
56
import { dispatch } from 'use-bus'
67

78
import {
@@ -11,7 +12,6 @@ import {
1112
Flex,
1213
FontSize,
1314
FontWeight,
14-
GlobalTheme,
1515
Icon,
1616
Opacity,
1717
Spacing,
@@ -26,7 +26,7 @@ const BREAKPOINT = '751px'
2626
export function DocSearch(props: DocSearchProps) {
2727
const searchButtonRef = useRef<HTMLButtonElement>(null)
2828
const [isOpen, setIsOpen] = useState(false)
29-
const [initialQuery, setInitialQuery] = useState<string | undefined>(props?.initialQuery || undefined)
29+
const [initialQuery, setInitialQuery] = useState<string | undefined>(props.initialQuery || undefined)
3030

3131
const onOpen = useCallback(() => {
3232
setIsOpen(true)
@@ -74,7 +74,7 @@ export function DocSearch(props: DocSearchProps) {
7474
}}
7575
>
7676
<Icon.Search size="14px" title="" sx={{ flexShrink: 0 }} />
77-
<Text.P14 size="14px">{props?.translations?.button?.buttonText ?? 'Search'}</Text.P14>
77+
<Text.P14 size="14px">{props.translations?.button?.buttonText ?? 'Search'}</Text.P14>
7878
{/* TODO: Remove `fontFamily: 'inherit'` when it's included in `@edgeandnode/components`'s global styles */}
7979
<Text.P14
8080
as="kbd"
@@ -96,15 +96,15 @@ export function DocSearch(props: DocSearchProps) {
9696
{...props}
9797
initialScrollY={window.scrollY}
9898
initialQuery={initialQuery}
99-
translations={props?.translations?.modal}
99+
translations={props.translations?.modal}
100100
onClose={onClose}
101101
/>,
102102
document.body
103103
)
104104
: null}
105105

106106
<Global
107-
styles={(theme: GlobalTheme) => ({
107+
styles={(theme: Theme) => ({
108108
html: {
109109
'--docsearch-spacing': '0 !important',
110110
'--docsearch-container-background': `${theme.colors!.Midnight88} !important`,

components/NavTree.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { keyframes } from '@emotion/react'
22
import * as Collapsible from '@radix-ui/react-collapsible'
3-
import { Context, createContext, HTMLAttributes, useContext, useState } from 'react'
3+
import { createContext, HTMLAttributes, useContext, useState } from 'react'
44
import { SxProp } from 'theme-ui'
55

66
import {
77
buildTransition,
8+
Divider,
89
Flex,
910
Icon,
1011
IconProps,
1112
Locale,
12-
NewGDSDivider,
1313
Spacing,
1414
Text,
1515
TextProps,
@@ -180,7 +180,7 @@ const NavTreeGroupContent = ({ children, ...props }: NavTreeGroupContentProps) =
180180
const NavTreeDivider = (props: NavTreeDividerProps) => {
181181
return (
182182
<li aria-hidden="true" sx={{ my: Spacing['8px'] }} {...props}>
183-
<NewGDSDivider />
183+
<Divider />
184184
</li>
185185
)
186186
}

layout/MDXLayout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PropsWithChildren, useCallback, useMemo } from 'react'
55
import { useSet } from 'react-use'
66
import { ThemeUIStyleObject } from 'theme-ui'
77

8-
import { Flex, NewGDSDivider, NewGDSDividerProps, Spacing } from '@edgeandnode/components'
8+
import { Divider, DividerProps, Flex, Spacing } from '@edgeandnode/components'
99

1010
import {
1111
Blockquote,
@@ -38,7 +38,7 @@ const mdxComponents = {
3838
blockquote: Blockquote,
3939
pre: CodeBlock,
4040
code: CodeInline,
41-
hr: (props: NewGDSDividerProps) => <NewGDSDivider sx={{ my: Spacing['32px'] }} {...props} />,
41+
hr: (props: DividerProps) => <Divider sx={{ my: Spacing['32px'] }} {...props} />,
4242
h1: Heading.H1,
4343
h2: Heading.H2,
4444
h3: Heading.H3,

layout/MDXLayoutOutline.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useContext, useEffect, useState } from 'react'
22

3-
import { buildTransition, Flex, NewGDSDivider, Spacing, Text } from '@edgeandnode/components'
3+
import { buildTransition, Divider, Flex, Spacing, Text } from '@edgeandnode/components'
44

55
import { EditPageLink, Link } from '@/components'
66
import { useI18n } from '@/i18n'
@@ -37,7 +37,7 @@ export const MDXLayoutOutline = () => {
3737
<Flex.Row>
3838
<EditPageLink />
3939
</Flex.Row>
40-
<NewGDSDivider sx={{ my: Spacing['32px'] }} />
40+
<Divider sx={{ my: Spacing['32px'] }} />
4141
<nav sx={{ paddingInlineEnd: '16px' }}>
4242
<Text.C10 as="header" color="White64" sx={{ mb: Spacing['12px'] }}>
4343
{t('global.pageSections')}

layout/MDXLayoutPagination.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useContext } from 'react'
22

3-
import { buildShadow, buildTransition, Flex, Icon, NewGDSDivider, Spacing, Text } from '@edgeandnode/components'
3+
import { buildShadow, buildTransition, Divider, Flex, Icon, Spacing, Text } from '@edgeandnode/components'
44

55
import { Link } from '@/components'
66
import { useI18n } from '@/i18n'
@@ -12,7 +12,7 @@ export const MDXLayoutPagination = () => {
1212

1313
return (
1414
<div>
15-
<NewGDSDivider diamonds />
15+
<Divider diamonds />
1616
<Flex.Row justify="space-between" sx={{ mt: Spacing['32px'], overflow: 'hidden' }}>
1717
<div>
1818
{previousPage ? (

navigation/navigation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const navigation = (locale: AppLocale): NavItemDefinition[] => [
4949
slug: 'glossary',
5050
},
5151
{
52-
slug: 'tokenomics',
52+
slug: 'tokenomics',
5353
},
5454
{
5555
divider: true,

navigation/utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const getNavItems = async (locale: AppLocale = defaultLocale): Promise<Na
3333
const filePath = `${path}${path.endsWith('/') ? 'index' : ''}`
3434
const filesToTry = [`${locale}${filePath}.mdx`, `${locale}${filePath}.tsx`, `[locale]${filePath}.tsx`]
3535
let currentTry = 0
36+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
3637
while (true) {
3738
try {
3839
const fileToTry = filesToTry[currentTry]
@@ -98,7 +99,7 @@ export const getNavItems = async (locale: AppLocale = defaultLocale): Promise<Na
9899
items.push(await handlePromise(promise))
99100
}
100101

101-
let lastFilteredItem: NavItem | null = null
102+
let lastFilteredItem = null as NavItem | null
102103
const filteredItems: NavItem[] = items.filter((item) => {
103104
// Item is a page that doesn't exist in that locale
104105
if (item === null) {

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"pre-push": "yarn build"
2121
},
2222
"dependencies": {
23-
"@docsearch/react": "^3.3.2",
24-
"@edgeandnode/components": "^24.5.0",
23+
"@docsearch/react": "^3.3.3",
24+
"@edgeandnode/components": "^25.1.0",
2525
"@emotion/react": "^11.10.5",
2626
"@mdx-js/loader": "^2.2.1",
2727
"@mdx-js/react": "^2.2.1",
2828
"@next/mdx": "^12.3.4",
2929
"@radix-ui/react-collapsible": "1.0.1",
30-
"@radix-ui/react-popover": "^1.0.2",
30+
"@radix-ui/react-popover": "^1.0.3",
3131
"@radix-ui/react-visually-hidden": "^1.0.1",
3232
"@reach/auto-id": "^0.18.0",
3333
"lodash": "^4.17.21",
@@ -43,26 +43,26 @@
4343
"use-bus": "^2.5.2"
4444
},
4545
"devDependencies": {
46-
"@edgeandnode/eslint-config": "^1.1.0",
47-
"@sindresorhus/slugify": "^2.1.1",
46+
"@edgeandnode/eslint-config": "^1.3.0",
47+
"@sindresorhus/slugify": "^2.2.0",
4848
"@svgr/webpack": "^6.5.1",
4949
"@types/color": "^3.0.3",
5050
"@types/lodash": "^4.14.191",
51-
"@types/node": "^16.18.11",
52-
"@types/react": "^17.0.52",
51+
"@types/node": "^16.18.12",
52+
"@types/react": "^17.0.53",
5353
"@types/react-dom": "^17.0.18",
54-
"acorn": "^8.8.1",
54+
"acorn": "^8.8.2",
5555
"acorn-jsx": "^5.3.2",
56-
"eslint": "^8.31.0",
56+
"eslint": "^8.33.0",
5757
"husky": "^8.0.3",
5858
"lint-staged": "^13.1.0",
5959
"path": "^0.12.7",
60-
"prettier": "^2.8.2",
60+
"prettier": "^2.8.3",
6161
"remark-frontmatter": "^4.0.1",
6262
"remark-mdx-frontmatter": "^2.1.1",
6363
"serialize-as-code": "^2.0.2",
64-
"typescript": "4.9.4",
65-
"unist-util-visit": "^4.1.1",
64+
"typescript": "4.9.5",
65+
"unist-util-visit": "^4.1.2",
6666
"url": "^0.11.0"
6767
},
6868
"resolutions": {

pages/_document.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Script from 'next/script'
44
import { defaultLocale, extractLocaleFromPath, getHtmlAttributesForLocale, Locale } from '@edgeandnode/components'
55

66
type MyDocumentProps = DocumentInitialProps & {
7-
locale: Locale
7+
locale: Locale | null
88
}
99

1010
export default class MyDocument extends Document {
@@ -34,14 +34,6 @@ export default class MyDocument extends Document {
3434
<body>
3535
<Main />
3636
<NextScript />
37-
<Script id="matomo" type="module" strategy="afterInteractive">{`
38-
const _paq = window._paq = window._paq || [];
39-
_paq.push(['trackPageView'], ['enableLinkTracking'], ['setTrackerUrl', 'https://thegraph.matomo.cloud/matomo.php'], ['setSiteId', '1']);
40-
const g = document.createElement('script');
41-
g.async = true;
42-
g.src = '//cdn.matomo.cloud/thegraph.matomo.cloud/matomo.js';
43-
document.body.append(g);
44-
`}</Script>
4537
<Script id="pendo" type="module" strategy="afterInteractive">{`
4638
(function(p,e,n,d,o){
4739
var v,w,x,y,z;o=p[d]=p[d]||{};o._q=o._q||[];

0 commit comments

Comments
 (0)