[examples/openspending] - openspending v0.2 (#907)

* [examples/openspending] - openspending v0.2

* [examples/openspending][m] - fix build

* [examples/openspending][xs] - fix build

* [examples/openspending][xs] - add prebuild step

* [examples/openspending][m] - fix requested by demenech

* [examples/openspending][sm] - remove links + fix bug
This commit is contained in:
Luccas Mateus
2023-05-30 20:22:58 -03:00
committed by GitHub
parent cb7d801968
commit 14974edcbf
474 changed files with 25289 additions and 116 deletions

View File

@@ -3,10 +3,31 @@ import './styles.css';
import { NextSeo } from 'next-seo';
import { useEffect } from 'react';
import { pageview } from '@flowershow/core';
import Script from 'next/script';
import Head from 'next/head';
import { useRouter } from 'next/router';
import {
Layout,
SearchProvider,
pageview,
ThemeProvider,
NavItem,
NavGroup,
} from '@flowershow/core';
export interface CustomAppProps {
meta: {
showToc: boolean;
showEditLink: boolean;
showSidebar: boolean;
showComments: boolean;
urlPath: string; // not sure what's this for
editUrl?: string;
[key: string]: any;
};
siteMap?: Array<NavItem | NavGroup>;
[key: string]: any;
}
function CustomApp({ Component, pageProps }: AppProps) {
const router = useRouter();
@@ -25,19 +46,24 @@ function CustomApp({ Component, pageProps }: AppProps) {
return (
<>
<Head>
<link rel="shortcut icon" href="/squared_logo.png" />
</Head>
<NextSeo title="OpenSpending" />
<Script
strategy="afterInteractive"
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TOKEN}`}
/>
<Script
id="gtag-init"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
<ThemeProvider
disableTransitionOnChange
attribute="class"
forcedTheme={'light'}
>
<Head>
<link rel="shortcut icon" href="/squared_logo.png" />
</Head>
<NextSeo title="OpenSpending" />
<Script
strategy="afterInteractive"
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TOKEN}`}
/>
<Script
id="gtag-init"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
@@ -45,12 +71,13 @@ function CustomApp({ Component, pageProps }: AppProps) {
page_path: window.location.pathname,
});
`,
}}
/>
}}
/>
<main className="app">
<Component {...pageProps} />
</main>
<main className="app">
<Component {...pageProps} />
</main>
</ThemeProvider>
</>
);
}