Skip to content

Commit

Permalink
refactor: musor chopilmoqda v2
Browse files Browse the repository at this point in the history
  • Loading branch information
shakhzodkudratov committed Oct 15, 2024
1 parent 4f6f9d8 commit 77ab1c3
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 667 deletions.
64 changes: 0 additions & 64 deletions components/APIReferences.tsx

This file was deleted.

39 changes: 0 additions & 39 deletions components/core/Providers.tsx

This file was deleted.

File renamed without changes.
63 changes: 0 additions & 63 deletions components/react/docs/Header.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions components/react/docs/HeaderVideo.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions components/react/docs/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions lib/address.ts

This file was deleted.

3 changes: 0 additions & 3 deletions lib/error.ts

This file was deleted.

25 changes: 0 additions & 25 deletions lib/gtag.ts

This file was deleted.

21 changes: 0 additions & 21 deletions lib/prefetchStaticProps.ts

This file was deleted.

6 changes: 0 additions & 6 deletions lib/provider.ts

This file was deleted.

47 changes: 1 addition & 46 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,11 @@
import type { AppProps } from 'next/app';

import { useRouter } from 'next/router';

import Script from 'next/script';

import * as React from 'react';

import '../styles/globals.css';

import * as gtag from '../lib/gtag';

function App({ Component, pageProps }: AppProps<{ dehydratedState: string }>) {
const getLayout =
(Component as any).getLayout || ((page: React.ReactElement) => page);

const router = useRouter();
React.useEffect(() => {
const handleRouteChange = (url: string) => {
gtag.pageview(url);
};
router.events.on('routeChangeComplete', handleRouteChange);
router.events.on('hashChangeComplete', handleRouteChange);
return () => {
router.events.off('routeChangeComplete', handleRouteChange);
router.events.off('hashChangeComplete', handleRouteChange);
};
}, [router.events]);

return (
<>
{/* Global Site Tag (gtag.js) - Google Analytics */}
<Script
strategy="afterInteractive"
src={`https://www.googletagmanager.com/gtag/js?id=${gtag.GA_TRACKING_ID}`}
/>
<Script
id="gtag-init"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${gtag.GA_TRACKING_ID}', {
page_path: window.location.pathname,
});
`,
}}
/>
{getLayout(<Component {...pageProps} />)}
</>
);
return <Component {...pageProps} />;
}

export default App;
6 changes: 1 addition & 5 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getCssText } from '@livepeer/react';
import { SkipNavLink } from '@reach/skip-nav';
import {
Head,
Expand All @@ -14,10 +13,7 @@ class Document extends NextDocument {
return (
<Html lang="en">
<Head>
<style
id="stitches"
dangerouslySetInnerHTML={{ __html: getCssText() }}
/>
<style id="stitches" />
{/* Global Site Tag (gtag.js) - Google Analytics */}
<script
dangerouslySetInnerHTML={{
Expand Down
Loading

0 comments on commit 77ab1c3

Please sign in to comment.