console/packages/web/docs/theme.config.tsx
renovate[bot] 95304fb338
fix(deps): update dependency @theguild/components to v6.6.3 (#5208)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru>
Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
2024-07-23 12:42:43 +02:00

63 lines
1.7 KiB
TypeScript

import { useRouter } from 'next/router';
import { defineConfig, Footer, Giscus, PRODUCTS, useConfig, useTheme } from '@theguild/components';
import { ProductUpdateBlogPostHeader } from './src/components/product-update-blog-post-header';
export default defineConfig({
docsRepositoryBase: 'https://github.com/kamilkisiela/graphql-hive/tree/main/packages/web/docs',
footer: {
component: (
<Footer
resources={[
{
children: 'Privacy Policy',
href: 'https://the-guild.dev/graphql/hive/privacy-policy.pdf',
title: 'Privacy Policy',
},
{
children: 'Terms of Use',
href: 'https://the-guild.dev/graphql/hive/terms-of-use.pdf',
title: 'Terms of Use',
},
]}
/>
),
},
main({ children }) {
const { resolvedTheme } = useTheme();
const { route } = useRouter();
const config = useConfig();
if (route === '/product-updates') {
return <>{children}</>;
}
if (route.startsWith('/product-updates')) {
children = (
<>
<ProductUpdateBlogPostHeader meta={config.frontMatter as any} />
{children}
</>
);
}
return (
<>
{children}
<Giscus
// ensure giscus is reloaded when client side route is changed
key={route}
repo="kamilkisiela/graphql-hive"
repoId="R_kgDOHWr5kA"
category="Docs Discussions"
categoryId="DIC_kwDOHWr5kM4CSDSS"
mapping="pathname"
theme={resolvedTheme}
/>
</>
);
},
description: 'Schema registry for your GraphQL workflows',
websiteName: 'Hive',
logo: PRODUCTS.HIVE.logo({ className: 'w-8' }),
});