fix: linting

This commit is contained in:
Nicholas Tindle
2024-09-10 22:03:55 -05:00
parent ae95bad6fb
commit e604264f82

View File

@@ -1,10 +1,11 @@
import React, { createContext, useContext, useEffect } from 'react';
import logPageViewAction from './actions';
import React, { createContext, useContext, useEffect } from "react";
import logPageViewAction from "./actions";
const PageViewContext = createContext<null>(null);
export const PageViewProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
export const PageViewProvider: React.FC<{ children: React.ReactNode }> = ({
children,
}) => {
useEffect(() => {
const logPageView = async () => {
const pageViewData = { page: window.location.pathname, data: {} };
@@ -12,14 +13,11 @@ export const PageViewProvider: React.FC<{ children: React.ReactNode }> = ({ chil
};
logPageView().catch(console.error);
}, []);
return (
<PageViewContext.Provider value={null}>
{children}
</PageViewContext.Provider>
<PageViewContext.Provider value={null}>{children}</PageViewContext.Provider>
);
};
export const usePageViews = () => useContext(PageViewContext);
export const usePageViews = () => useContext(PageViewContext);