diff --git a/pages/index.tsx b/pages/index.tsx index ed7d090d..6af4b55d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -39,7 +39,6 @@ export default function Homepage({ <> +
Plural reduces cluster upgrade cycles from months to hours at enterprise scale with streamlined dependency management.
} announcementChip={announcementChip} ctas={ -
+
+
} /> @@ -88,15 +98,6 @@ export default function Homepage({ width={1248} /> )} -
@@ -180,12 +181,12 @@ const homepageGradient = ` const playButtonSVG = ( ) { + return +} + +export const getStaticPaths: GetStaticPaths = async () => { + const { data, error } = await directusClient.query< + ResourcesPageSlugsQuery, + ResourcesPageSlugsQueryVariables + >({ + query: ResourcesPageSlugsDocument, + }) + + if (error) { + console.error('GraphQL query error in static:', error) + } + + return { + paths: data.resource_pages.map((page) => ({ + params: { resource: page.slug }, + })), + fallback: 'blocking', + } +} + +export const getStaticProps = async (context) => { + const slug = + typeof context?.params?.resource === 'string' + ? context?.params?.resource + : null + + if (!slug) { + return { notFound: true } + } + + const { data, error } = await directusClient.query< + ResourcePageQuery, + ResourcePageQueryVariables + >({ + query: ResourcePageDocument, + variables: { slug }, + }) + + if (error) { + console.error('GraphQL query error in static: ', error) + } + const resourceInfo = data.resource_pages?.[0] || null + + if (!resourceInfo) { + return { notFound: true } + } + + return propsWithGlobalSettings({ + metaTitle: resourceInfo?.dropdown_title ?? '', + metaDescription: '', + footerVariant: FooterVariant.kitchenSink, + resourceInfo, + }) +} diff --git a/src/components/AppsList.tsx b/src/components/AppsList.tsx deleted file mode 100644 index 64307bec..00000000 --- a/src/components/AppsList.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { useMemo, useState } from 'react' - -import { - Input, - MagnifyingGlassIcon, - RepositoryChip, -} from '@pluralsh/design-system' -import Link from 'next/link' - -import chroma from 'chroma-js' -import Fuse from 'fuse.js' -import styled from 'styled-components' - -import { appUrl } from '@src/consts/routes' - -import { useRepos } from '../contexts/ReposContext' - -function AppsList({ className, ...props }: { className?: string }) { - const applications = useRepos() - const [search, setSearch] = useState('') - - const fuse = useMemo( - () => - new Fuse(applications, { - threshold: 0.3, - keys: ['name', 'displayName', 'tags.tag'], - }), - [applications] - ) - - const filteredApplications = search - ? fuse.search(search).map((x) => x.item) - : applications - - if (!applications || applications.length <= 0) { - return null - } - - return ( -
- setSearch(event.target.value)} - placeholder="Search an application" - startIcon={} - width="100%" - /> -
-
- {filteredApplications && - filteredApplications.map((application) => ( - - ))} -
- - ) -} - -export default styled(AppsList)(({ theme }) => ({ - 'ul, li': { - margin: 0, - padding: 0, - listStyle: 'none', - }, - '.appList': { - flexGrow: 1, - display: 'grid', - gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', - gridTemplateRows: 'repeat(auto-fill, 42px)', - gridColumnGap: theme.spacing.medium, - gridRowGap: '16px', - paddingRight: 'xsmall', - paddingBottom: 'medium', - minHeight: 'calc(100vh - var(--top-nav-height) - 420px)', - }, - '.inputWrap': { - position: 'sticky', - top: 'var(--top-nav-height)', - marginBottom: theme.spacing.large, - backgroundColor: theme.colors['fill-zero'], - - '&::after': { - content: '""', - display: 'block', - position: 'absolute', - top: '100%', - left: 0, - width: '100%', - height: theme.spacing.large, - background: `linear-gradient(0deg, ${chroma( - theme.colors['fill-zero'] - ).alpha(0.0)} 0%, ${chroma(theme.colors['fill-zero']).alpha(1.0)} 100%)`, - }, - }, - '.searchInput': {}, -})) diff --git a/src/components/PageHeros.tsx b/src/components/PageHeros.tsx index a3b34943..458afacf 100644 --- a/src/components/PageHeros.tsx +++ b/src/components/PageHeros.tsx @@ -35,15 +35,12 @@ export function HeroMainText({ )} {...props} > -
+

{preHeading && ( - <> - - {preHeading} - - - + + {preHeading} + )} {heading}

@@ -61,8 +58,8 @@ export function HeroMainText({ )}
- {ctas &&
{ctas}
} - {children &&
{children}
} + {ctas} + {children}
) } @@ -160,9 +157,9 @@ export function HomePageHero({ {description}} + description={description} ctas={ctas} - className="mx-auto" + className="max-w-[768px]" /> diff --git a/src/components/custom-page/LargeImage.tsx b/src/components/custom-page/LargeImage.tsx index 6e4dfd49..4542475a 100644 --- a/src/components/custom-page/LargeImage.tsx +++ b/src/components/custom-page/LargeImage.tsx @@ -46,7 +46,8 @@ export function LargeImage({ {bodyText} {ctaText && (