From ba5d1693e10eb202a7fb5ea40f5b248e8fa50a2a Mon Sep 17 00:00:00 2001
From: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com>
Date: Fri, 12 Apr 2024 09:17:14 -0300
Subject: [PATCH] feat: Track page load (#19)
---
index.html | 16 ++----
src/components/Icons/CameraIcon.tsx | 14 ++---
src/components/Icons/MicrophoneIcon.tsx | 30 +++++------
src/components/Icons/PeopleIcon.tsx | 8 +--
src/components/Icons/PhoneIcon.tsx | 18 +++----
src/components/Icons/SendIcon.tsx | 12 ++---
src/components/Icons/ShareScreenIcon.tsx | 16 +++---
src/main.tsx | 68 +++++++++++++-----------
8 files changed, 91 insertions(+), 91 deletions(-)
diff --git a/index.html b/index.html
index d5e7b91..8ef7192 100644
--- a/index.html
+++ b/index.html
@@ -4,20 +4,12 @@
-
-
+
+
-
-
Decentraland - Profile
+
+ Decentraland - Cast
diff --git a/src/components/Icons/CameraIcon.tsx b/src/components/Icons/CameraIcon.tsx
index 677f99b..8a5a665 100644
--- a/src/components/Icons/CameraIcon.tsx
+++ b/src/components/Icons/CameraIcon.tsx
@@ -9,9 +9,9 @@ const CameraIcon = ({ enabled = true, ...props }: Props) => {
id="Vector"
d="M28.28 24.2V30.536C28.28 31.0132 27.8932 31.4 27.416 31.4H11.864C11.3868 31.4 11 31.0132 11 30.536V17.864C11 17.3868 11.3868 17 11.864 17H27.416C27.8932 17 28.28 17.3868 28.28 17.864V24.2ZM28.28 24.2L35.5029 18.1809C36.0656 17.712 36.92 18.1121 36.92 18.8447V29.5554C36.92 30.2879 36.0656 30.6881 35.5029 30.2191L28.28 24.2Z"
stroke="#FCFCFC"
- stroke-width="1.92"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="1.92"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
@@ -20,11 +20,11 @@ const CameraIcon = ({ enabled = true, ...props }: Props) => {
-
+
)
}
diff --git a/src/components/Icons/MicrophoneIcon.tsx b/src/components/Icons/MicrophoneIcon.tsx
index 6ca2554..041befa 100644
--- a/src/components/Icons/MicrophoneIcon.tsx
+++ b/src/components/Icons/MicrophoneIcon.tsx
@@ -7,21 +7,21 @@ const MicrophoneIcon = ({ enabled = true, ...props }: Props) => {
) : (
@@ -29,23 +29,23 @@ const MicrophoneIcon = ({ enabled = true, ...props }: Props) => {
-
+
)
}
diff --git a/src/components/Icons/PeopleIcon.tsx b/src/components/Icons/PeopleIcon.tsx
index 0215c0f..dd1114b 100644
--- a/src/components/Icons/PeopleIcon.tsx
+++ b/src/components/Icons/PeopleIcon.tsx
@@ -4,15 +4,15 @@ import { Props } from './Icons.type'
const PeopleIcon = (props: Props) => (
)
diff --git a/src/components/Icons/SendIcon.tsx b/src/components/Icons/SendIcon.tsx
index c5b653e..8d4c82c 100644
--- a/src/components/Icons/SendIcon.tsx
+++ b/src/components/Icons/SendIcon.tsx
@@ -6,16 +6,16 @@ const SendIcon = (props: Props) => (
)
diff --git a/src/components/Icons/ShareScreenIcon.tsx b/src/components/Icons/ShareScreenIcon.tsx
index 2a503fe..e7853aa 100644
--- a/src/components/Icons/ShareScreenIcon.tsx
+++ b/src/components/Icons/ShareScreenIcon.tsx
@@ -4,24 +4,24 @@ import { Props } from './Icons.type'
const ShareScreenIcon = ({ enabled = false, ...props }: Props) => {
return enabled ? (
) : (
)
diff --git a/src/main.tsx b/src/main.tsx
index 88c438c..5bdb693 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,9 +1,10 @@
/* eslint-disable import/order */
import 'semantic-ui-css/semantic.min.css'
-import React from 'react'
+import React, { useEffect } from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
-import { RouterProvider, createBrowserRouter } from 'react-router-dom'
+import { BrowserRouter, Route, Routes, useLocation } from 'react-router-dom'
+import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils'
import ModalProvider from 'decentraland-dapps/dist/providers/ModalProvider'
import TranslationProvider from 'decentraland-dapps/dist/providers/TranslationProvider'
import WalletProvider from 'decentraland-dapps/dist/providers/WalletProvider'
@@ -17,33 +18,40 @@ import Conference from './components/Pages/Conference'
import 'decentraland-ui/dist/themes/alternative/light-theme.css'
import './index.css'
-const router = createBrowserRouter([
- {
- path: '/',
- element:
- },
- {
- path: 'sign-in',
- element:
- },
- {
- path: '/meet/:server',
- element:
- }
-])
+const SiteRoutes = () => {
+ const location = useLocation()
+ const analytics = getAnalytics()
-const component = (
-
-
-
-
-
-
-
-
-
-
-
-)
+ useEffect(() => {
+ analytics.page()
+ }, [location, analytics])
-ReactDOM.render(component, document.getElementById('root') as HTMLElement)
+ return (
+
+ } />
+ } />
+ } />
+ } />
+
+ )
+}
+
+const component = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+ReactDOM.render(component(), document.getElementById('root') as HTMLElement)