Skip to content

Commit

Permalink
📦 chore(package.json): add @vercel/analytics dependency
Browse files Browse the repository at this point in the history
✨ feat(index.js): add @vercel/analytics to the app to track user behavior
The @vercel/analytics package was added to the project to enable tracking of user behavior. The Analytics component was added to the root of the app to enable tracking of user behavior across all pages.
  • Loading branch information
romantech committed May 13, 2023
1 parent 147746c commit c59c93a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@ant-design/icons": "^4.7.0",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@vercel/analytics": "^1.0.1",
"antd": "^4.16.13",
"axios": "^0.24.0",
"immer": "^9.0.6",
Expand Down
20 changes: 12 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { applyMiddleware, compose, createStore } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import { ThemeProvider } from 'styled-components/macro';
import { createRoot } from 'react-dom/client';
import { Analytics } from '@vercel/analytics/react';
import theme from './Styles/theme';
import GlobalStyle from './Styles/globalStyle';
import Routes from './Routes';
Expand All @@ -29,12 +30,15 @@ const persistor = persistStore(store);
sagaMiddleware.run(rootSaga);

root.render(
<Provider store={store}>
<PersistGate persistor={persistor}>
<ThemeProvider theme={theme}>
<GlobalStyle />
<Routes />
</ThemeProvider>
</PersistGate>
</Provider>,
<React.StrictMode>
<Provider store={store}>
<PersistGate persistor={persistor}>
<ThemeProvider theme={theme}>
<GlobalStyle />
<Routes />
</ThemeProvider>
</PersistGate>
<Analytics />
</Provider>
</React.StrictMode>,
);
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2385,6 +2385,11 @@
"@typescript-eslint/types" "5.59.5"
eslint-visitor-keys "^3.3.0"

"@vercel/analytics@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-1.0.1.tgz#38308a626c91866cb00a249c08bf65251e9b9d81"
integrity sha512-Ux0c9qUfkcPqng3vrR0GTrlQdqNJ2JREn/2ydrVuKwM3RtMfF2mWX31Ijqo1opSjNAq6rK76PwtANw6kl6TAow==

"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5":
version "1.11.6"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24"
Expand Down

1 comment on commit c59c93a

@vercel
Copy link

@vercel vercel bot commented on c59c93a May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

beer-table – ./

beer-table-git-master-romantech.vercel.app
beer-table.vercel.app
beer-table-romantech.vercel.app

Please sign in to comment.