Skip to content

Commit

Permalink
add analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitayutanov committed Dec 3, 2024
1 parent 2bb7c22 commit 6f9c9e7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-to-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
VITE_IPFS_GATEWAY_ADDRESS=${{ secrets.VITE_IPFS_GATEWAY_ADDRESS }}
VITE_INDEXER_ADDRESS=${{ secrets.VITE_INDEXER_ADDRESS }}
VITE_INDEXER_WS_ADDRESS=${{ secrets.VITE_INDEXER_WS_ADDRESS }}
VITE_GTM_ID=${{ secrets.VITE_GTM_ID }}
deploy-to-k8s:
needs: [prepair, build-and-push-image]
Expand Down
1 change: 1 addition & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ VITE_IPFS_UPLOAD_ADDRESS=
VITE_IPFS_GATEWAY_ADDRESS=
VITE_INDEXER_ADDRESS=
VITE_INDEXER_WS_ADDRESS=
VITE_GTM_ID=
4 changes: 3 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ ARG VITE_NODE_ADDRESS \
VITE_IPFS_UPLOAD_ADDRESS \
VITE_IPFS_GATEWAY_ADDRESS \
VITE_INDEXER_ADDRESS \
VITE_INDEXER_WS_ADDRESS
VITE_INDEXER_WS_ADDRESS \
VITE_GTM_ID
ENV VITE_NODE_ADDRESS=${VITE_NODE_ADDRESS} \
VITE_IPFS_UPLOAD_ADDRESS=${VITE_IPFS_UPLOAD_ADDRESS} \
VITE_IPFS_GATEWAY_ADDRESS=${VITE_IPFS_GATEWAY_ADDRESS} \
VITE_INDEXER_ADDRESS=${VITE_INDEXER_ADDRESS} \
VITE_INDEXER_WS_ADDRESS=${VITE_INDEXER_WS_ADDRESS} \
VITE_GTM_ID=${VITE_GTM_ID} \
DISABLE_ESLINT_PLUGIN=true

WORKDIR /opt
Expand Down
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
"graphql-request": "6.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-gtm-module": "2.0.11",
"react-hook-form": "7.49.2",
"react-router-dom": "6.21.0",
"zod": "3.22.4"
},
"devDependencies": {
"@types/react-gtm-module": "2.0.4",
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/client-preset": "4.2.4",
"@graphql-typed-document-node/core": "3.2.0",
Expand Down
16 changes: 16 additions & 0 deletions frontend/pnpm-lock.yaml

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

4 changes: 3 additions & 1 deletion frontend/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const ADDRESS = {
INDEXER_WS: import.meta.env.VITE_INDEXER_WS_ADDRESS as string,
};

const GTM_ID = import.meta.env.VITE_GTM_ID as string | undefined;

const ROUTE = {
HOME: '/',
CREATE_COLLECTION: '/create',
Expand All @@ -27,4 +29,4 @@ const SCHEMA = {
.transform((value) => decodeAddress(value)),
};

export { ADDRESS, ROUTE, SCHEMA };
export { ADDRESS, GTM_ID, ROUTE, SCHEMA };
5 changes: 4 additions & 1 deletion frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import '@gear-js/vara-ui/dist/style.css';
import React from 'react';
import ReactDOM from 'react-dom/client';
import TagManager from 'react-gtm-module';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';

import { App } from './App';
import { PrivateRoute } from './components';
import { ROUTE } from './consts';
import { GTM_ID, ROUTE } from './consts';
import { Collection, CreateCollection, NFT, Lists, NotFound } from './pages';
import './index.scss';

if (GTM_ID) TagManager.initialize({ gtmId: GTM_ID });

const PRIVATE_ROUTES = [
{
path: ROUTE.CREATE_COLLECTION,
Expand Down

0 comments on commit 6f9c9e7

Please sign in to comment.