Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(PPDSC-2850): add next links to homepage #679

Merged
merged 12 commits into from
Mar 9, 2023
144 changes: 72 additions & 72 deletions site/components/__tests__/__snapshots__/site-header.test.tsx.snap

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions site/components/feature-card/feature-card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import NextLink from 'next/link';
import {
Block,
Visible,
Expand Down Expand Up @@ -62,13 +63,17 @@ const ArrowLink: React.FC<ArrowLinkProps> = ({
return (
<div data-testid={dataTestId}>
{!href && (
<LinkStandalone
href={buttonHref as string}
overrides={combinedOverrides}
>
{label}
{icon || <IconFilledChevronRight overrides={{size: 'iconSize020'}} />}
</LinkStandalone>
<NextLink legacyBehavior href={buttonHref as string} passHref>
mutebg marked this conversation as resolved.
Show resolved Hide resolved
<LinkStandalone
href={buttonHref as string}
overrides={combinedOverrides}
>
{label}
{icon || (
<IconFilledChevronRight overrides={{size: 'iconSize020'}} />
)}
</LinkStandalone>
</NextLink>
)}
{href && (
<TextBlock
Expand Down
46 changes: 24 additions & 22 deletions site/components/homepage/explore/explore.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import {Headline, TextBlock, GridLayout, Card} from 'newskit';
import NextLink from 'next/link';
import {ContentPrimary} from '../../content-structure';
import {Illustration} from '../../illustrations/illustration-loader';

Expand Down Expand Up @@ -49,31 +50,32 @@ export const Explore = () => (
columnGap="space050"
>
{cardsContent.map(({media, title, href, description}) => (
<Card
key={href}
href={href}
media={() => media}
overrides={{
stylePreset: 'homepageCard',
marginBlockEnd: {xs: 'space080', md: 'space000'},
}}
>
<Headline
<NextLink legacyBehavior href={href} key={href} passHref>
<Card
href={href}
media={() => media}
overrides={{
marginBlockEnd: 'space040',
typographyPreset: 'editorialHeadline020',
heading: {stylePreset: 'exploreCardLink'},
stylePreset: 'homepageCard',
marginBlockEnd: {xs: 'space080', md: 'space000'},
}}
>
{title}
</Headline>
<TextBlock
marginBlockEnd="space040"
typographyPreset="editorialParagraph020"
>
{description}
</TextBlock>
</Card>
<Headline
overrides={{
marginBlockEnd: 'space040',
typographyPreset: 'editorialHeadline020',
heading: {stylePreset: 'exploreCardLink'},
}}
>
{title}
</Headline>
<TextBlock
marginBlockEnd="space040"
typographyPreset="editorialParagraph020"
>
{description}
</TextBlock>
</Card>
</NextLink>
))}
</GridLayout>
</ContentPrimary>
Expand Down
60 changes: 36 additions & 24 deletions site/components/homepage/hero/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,50 @@ export const Hero = ({
}}
>
<GridLayoutItem>
<NextLink
legacyBehavior
href="/getting-started/design/design-overview"
passHref
>
<>
<Visible xs sm>
<>
<Visible xs sm>
<NextLink
legacyBehavior
href={DESIGN_BUTTON_PROPS.href}
passHref
>
<Button {...DESIGN_BUTTON_PROPS}>Designing</Button>
</Visible>
<Visible md lg xl>
</NextLink>
</Visible>
<Visible md lg xl>
<NextLink
legacyBehavior
href={DESIGN_BUTTON_PROPS.href}
passHref
>
<Button {...DESIGN_BUTTON_PROPS}>Start designing</Button>
</Visible>
</>
</NextLink>
</NextLink>
</Visible>
</>
</GridLayoutItem>
<GridLayoutItem>
<NextLink
legacyBehavior
href="/getting-started/code/engineering-quickstart"
passHref
>
<>
<Visible xs sm>
<>
<Visible xs sm>
<NextLink
legacyBehavior
href={DEVELOPING_BUTTON_PROPS.href}
passHref
>
<Button {...DEVELOPING_BUTTON_PROPS}>Developing</Button>
</Visible>
<Visible md lg xl>
</NextLink>
</Visible>
<Visible md lg xl>
<NextLink
legacyBehavior
href={DEVELOPING_BUTTON_PROPS.href}
passHref
>
<Button {...DEVELOPING_BUTTON_PROPS}>
Start developing
</Button>
</Visible>
</>
</NextLink>
</NextLink>
</Visible>
</>
</GridLayoutItem>
</GridLayout>
</GridLayoutItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/getting-started/design/design-overview/"
href="/getting-started/design/design-overview"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -356,7 +356,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/getting-started/code/engineering-overview/"
href="/getting-started/code/engineering-overview"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -398,7 +398,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/getting-started/code/instrumentation/"
href="/getting-started/code/instrumentation"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -453,7 +453,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/components/overview/"
href="/components/overview"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -495,7 +495,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/overview/"
href="/theme/overview"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -537,7 +537,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/components/button/"
href="/components/button"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -592,7 +592,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/presets/style-presets/"
href="/theme/presets/style-presets"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -634,7 +634,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/presets/transition-presets/"
href="/theme/presets/transition-presets"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -676,7 +676,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/presets/typography-presets/"
href="/theme/presets/typography-presets"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -731,7 +731,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/foundation/design-tokens/"
href="/theme/foundation/design-tokens"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -773,7 +773,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/foundation/colours/"
href="/theme/foundation/colours"
>
<span
class="emotion-7"
Expand Down Expand Up @@ -815,7 +815,7 @@ exports[`NewStartScreen renders correctly 1`] = `
>
<a
class="emotion-6"
href="/theme/foundation/fonts/"
href="/theme/foundation/fonts"
>
<span
class="emotion-7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/getting-started/design/design-overview/"
href="/getting-started/design/design-overview"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -363,7 +363,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/getting-started/code/engineering-overview/"
href="/getting-started/code/engineering-overview"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -405,7 +405,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/getting-started/code/instrumentation/"
href="/getting-started/code/instrumentation"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -460,7 +460,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/components/overview/"
href="/components/overview"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -502,7 +502,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/overview/"
href="/theme/overview"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -544,7 +544,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/components/button/"
href="/components/button"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -599,7 +599,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/presets/style-presets/"
href="/theme/presets/style-presets"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -641,7 +641,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/presets/transition-presets/"
href="/theme/presets/transition-presets"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -683,7 +683,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/presets/typography-presets/"
href="/theme/presets/typography-presets"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -738,7 +738,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/foundation/design-tokens/"
href="/theme/foundation/design-tokens"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -780,7 +780,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/foundation/colours/"
href="/theme/foundation/colours"
>
<span
class="emotion-8"
Expand Down Expand Up @@ -822,7 +822,7 @@ exports[`Search renders correctly 1`] = `
>
<a
class="emotion-7"
href="/theme/foundation/fonts/"
href="/theme/foundation/fonts"
>
<span
class="emotion-8"
Expand Down
Loading