Skip to content

Commit

Permalink
docs(PPDSC-2850): add next links to homepage (#679)
Browse files Browse the repository at this point in the history
* fix(PPDSC-2850): add next links

* fix(PPDSC-2850): remove next link from featureCard

* fix(PPDSC-2850): test

* fix(PPDSC-2850): test

* fix(PPDSC-2850): brokenlinks

* fix(PPDSC-2850): broken links

* fix(PPDSC-2850): use link in site
  • Loading branch information
Xin00163 authored Mar 9, 2023
1 parent d433b0b commit 96d9764
Show file tree
Hide file tree
Showing 20 changed files with 240 additions and 247 deletions.
144 changes: 72 additions & 72 deletions site/components/__tests__/__snapshots__/site-header.test.tsx.snap

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions site/components/feature-card/feature-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
TextBlock,
useTheme,
toNewsKitIcon,
LinkStandalone,
Flag,
} from 'newskit';
import {ChevronRight as FilledChevronRight} from '@emotion-icons/material/ChevronRight';
Expand All @@ -24,6 +23,7 @@ import {
StyledFeatureCardVerticalMedia,
StyledCardLink,
} from './styled';
import {Link} from '../link';

const IconFilledChevronRight = toNewsKitIcon(FilledChevronRight);

Expand Down Expand Up @@ -62,13 +62,14 @@ const ArrowLink: React.FC<ArrowLinkProps> = ({
return (
<div data-testid={dataTestId}>
{!href && (
<LinkStandalone
<Link
type="standalone"
href={buttonHref as string}
overrides={combinedOverrides}
>
{label}
{icon || <IconFilledChevronRight overrides={{size: 'iconSize020'}} />}
</LinkStandalone>
</Link>
)}
{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
24 changes: 12 additions & 12 deletions site/components/search/__tests__/__snapshots__/search.test.ts.snap
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

0 comments on commit 96d9764

Please sign in to comment.