Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"@cube-dev/marketing-ui": "0.0.1-beta.22",
"@cube-dev/purple-banner": "https://github.com/cubedevinc/purple-banner/releases/download/v2.0.21/cube-dev-purple-banner-2.0.21.tgz",
"@cubejs-client/core": "^0.32.17",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-navigation-menu": "^1.1.3",
Expand Down
31 changes: 30 additions & 1 deletion docs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import "@/styles/images.css";
import "katex/dist/katex.min.css";
import "@cube-dev/marketing-ui/dist/index.css";

import PurpleBanner from '@cube-dev/purple-banner';
import localFont from "next/font/local";
import { Inter } from "next/font/google";
import { SearchProvider } from "@cube-dev/marketing-ui";
import { useRouter } from 'next/router';
import { useEffect } from 'react';
import { useEffect, useState } from 'react';

export const SourceCodePro = localFont({
src: "../fonts/SourceCodePro-Regular.woff2",
Expand Down Expand Up @@ -65,6 +66,11 @@ type Props = { origin: string | null };

export default function MyApp({ origin, Component, pageProps }: AppProps & Props) {
const router = useRouter()
const [pbVisible, setPbVisible] = useState(false)

useEffect(() => {
requestAnimationFrame(() => setPbVisible(true))
}, [])

// Track page views
useEffect(() => {
Expand Down Expand Up @@ -97,8 +103,31 @@ export default function MyApp({ origin, Component, pageProps }: AppProps & Props
--font-mono: ${JetBrainsMono.style.fontFamily};
--font-code: ${SourceCodePro.style.fontFamily};
--cube-font: ${CeraPro.style.fontFamily};
--purple-banner-font: ${CeraPro.style.fontFamily};
}
.pb-wrapper {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s linear;
will-change: max-height;
}
.pb-wrapper--visible {
max-height: 100px;
}
@media (max-width: 796px) {
.pb-wrapper--visible {
max-height: 160px;
}
}
`}</style>

<div className={pbVisible ? 'pb-wrapper pb-wrapper--visible' : 'pb-wrapper'}>
<PurpleBanner
utmSource="cube.dev"
debugMode={process.env.NEXT_PUBLIC_SHOW_PURPLE_BANNER === 'true'}
/>
</div>

<Component {...pageProps} />
</SearchProvider>
);
Expand Down