diff --git a/components/APIReferences.tsx b/components/APIReferences.tsx deleted file mode 100644 index 2e516ef..0000000 --- a/components/APIReferences.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { useTheme } from 'next-themes'; -import React from 'react'; -import { RedocStandalone } from 'redoc'; - -export default function APIReferences() { - const { theme } = useTheme(); - - const isDark = - theme === 'system' - ? window.matchMedia('(prefers-color-scheme: dark)').matches || - (window.matchMedia('(prefers-color-scheme: no-preference)').matches && - window.matchMedia('(prefers-color-scheme: light)').matches) - : theme === 'dark'; - - return ( -
- -
- ); -} diff --git a/components/core/Providers.tsx b/components/core/Providers.tsx deleted file mode 100644 index 5be048f..0000000 --- a/components/core/Providers.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { useTheme } from 'nextra-theme-docs'; -import { ReactNode, useMemo } from 'react'; - -import { SyncedTabsContext, SyncedTabsState } from './SyncedTabs'; -import { useLocalStorage } from '../../hooks'; - -type Props = { - children?: ReactNode; - dehydratedState?: string; -}; - -const themes: any = getThemes(); - -export function Providers({ children, dehydratedState }: Props) { - const { theme } = useTheme(); - - const [storedValue, setStoredValue] = useLocalStorage< - SyncedTabsState['store'] - >(`tabs`, {}); - - const syncedTabsState: SyncedTabsState = useMemo( - () => ({ - store: storedValue, - setNewIndex: (key, value) => { - setStoredValue({ - ...storedValue, - [key]: Number(value ?? 0), - }); - }, - }), - [storedValue, setStoredValue], - ); - - return ( - - {children} - - ); -} diff --git a/components/icons/github-sponsors.tsx b/components/github-sponsors.tsx similarity index 100% rename from components/icons/github-sponsors.tsx rename to components/github-sponsors.tsx diff --git a/components/react/docs/Header.tsx b/components/react/docs/Header.tsx deleted file mode 100644 index 184caac..0000000 --- a/components/react/docs/Header.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { useRouter } from 'next/router'; - -const TITLE_WITH_TRANSLATIONS: Record = { - 'en-UZ': 'livepeer.js', -}; - -export function Header() { - const { locale, defaultLocale = 'en-UZ' } = useRouter(); - const resolvedLocale = locale || defaultLocale; - const title = TITLE_WITH_TRANSLATIONS[resolvedLocale]; - - return ( -
-

{title}

- -
- - - - - - - - - - - - - - - -
-
- ); -} diff --git a/components/react/docs/HeaderVideo.tsx b/components/react/docs/HeaderVideo.tsx deleted file mode 100644 index cc0088a..0000000 --- a/components/react/docs/HeaderVideo.tsx +++ /dev/null @@ -1,34 +0,0 @@ -// import { Player } from '@livepeer/react'; -// import Image from 'next/image'; -// import * as React from 'react'; - -// import waterfallsPoster from '../../../public/images/waterfalls-poster.png'; - -// const PosterImage = () => { -// return ( -// -// ); -// }; - -// const playbackId = '667f7flfr0od837u'; - -// export function HeaderVideo() { -// return ( -// } -// showPipButton -// /> -// ); -// } diff --git a/components/react/docs/index.ts b/components/react/docs/index.ts deleted file mode 100644 index 2df7d53..0000000 --- a/components/react/docs/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Header'; -// export * from './HeaderVideo'; diff --git a/lib/address.ts b/lib/address.ts deleted file mode 100644 index 87bc4e3..0000000 --- a/lib/address.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function formatAddress(address: string) { - return `${address.slice(0, 6)}…${address.slice(38, 42)}`; -} diff --git a/lib/error.ts b/lib/error.ts deleted file mode 100644 index 03fad65..0000000 --- a/lib/error.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type ApiError = { - message: string; -}; diff --git a/lib/gtag.ts b/lib/gtag.ts deleted file mode 100644 index cae1e5e..0000000 --- a/lib/gtag.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_ID; - -// https://developers.google.com/analytics/devguides/collection/gtagjs/pages -export const pageview = (url: string) => { - (window).gtag('config', GA_TRACKING_ID, { - page_path: url, - }); -}; - -// https://developers.google.com/analytics/devguides/collection/gtagjs/events - -interface EventProps { - action: string; - category: string; - label: string; - value: string; -} - -export const event = ({ action, category, label, value }: EventProps) => { - (window).gtag('event', action, { - event_category: category, - event_label: label, - value: value, - }); -}; diff --git a/lib/prefetchStaticProps.ts b/lib/prefetchStaticProps.ts deleted file mode 100644 index b7ca5a7..0000000 --- a/lib/prefetchStaticProps.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { prefetchPlayer, studioProvider } from '@livepeer/react'; - -export const prefetchPlayerStaticProps = async (playbackId: string) => { - const dehydratedState = await prefetchPlayer( - { - playbackId, - }, - { - provider: studioProvider({ - apiKey: process.env.NEXT_PUBLIC_STUDIO_API_KEY ?? '', - }), - }, - ); - - return { - props: { - dehydratedState, - }, - revalidate: 600, - }; -}; diff --git a/lib/provider.ts b/lib/provider.ts deleted file mode 100644 index da91233..0000000 --- a/lib/provider.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defaultStudioConfig, studioProvider } from '@livepeer/react'; - -export const provider = studioProvider({ - apiKey: process.env.NEXT_PUBLIC_STUDIO_API_KEY ?? '', - baseUrl: defaultStudioConfig.baseUrl, -}); diff --git a/pages/_app.tsx b/pages/_app.tsx index 7866f9a..4bca304 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -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 */} -