Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/front-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: |
echo "VITE_NAVER_MAP_ID=${{ secrets.VITE_NAVER_MAP_ID }}" >> .env
echo "VITE_SERVER_ADDRESS=${{ secrets.VITE_SERVER_ADDRESS }}" >> .env
echo "VITE_GA_TRACKING_ID=${{ secrets.VITE_GA_TRACKING_ID }}" >> .env

- name: react build
run: npm run build
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"lodash": "^4.17.21",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-ga4": "^2.1.0",
"react-naver-maps": "^0.1.3",
"react-router-dom": "^7.1.1",
"react-table": "^7.8.0",
Expand Down
21 changes: 20 additions & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { NavermapsProvider } from 'react-naver-maps';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom';
import { useEffect } from 'react';
import ReactGA from 'react-ga4';
import LoginPage from './pages/LoginPage/LoginPage';
import MapPage from './pages/MapPage/MapPage';
import ManagePage from './pages/ManagePage/ManagePage';
Expand All @@ -11,6 +13,23 @@ import Home from './pages/ManagePage/Home';
import SteepSlopeDup from './pages/ManagePage/StepSlope/StepSlopeOutlier/SteepSlopeDup';
import SteepSlopeEmpty from './pages/ManagePage/StepSlope/StepSlopeOutlier/SteepSlopeEmpty';
const Router = () => {
const location = useLocation();

useEffect(() => {
ReactGA.initialize(import.meta.env.VITE_GA_TRACKING_ID, {
gtagOptions: {
debug_mode: import.meta.env.DEV,
},
});
}, []);

useEffect(() => {
ReactGA.send({
hitType: 'pageview',
page: location.pathname + location.search,
title: document.title,
});
}, [location]);
return (
<NavermapsProvider ncpClientId={`${import.meta.env.VITE_NAVER_MAP_ID}`}>
<BrowserRouter>
Expand Down
Loading