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
13 changes: 6 additions & 7 deletions src/components/ApiDocs/TopSections.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
import Button from "@components/Button";
import MarkdownContent from "@components/MarkdownContent.astro";
import { CodeBlock, MultiCode } from "@components/Code";
import Markdown from "@components/Markdown.astro";
import type { ApiTopSection } from "@lib/openapi/routes";
import { doc, resolveSchema } from "@lib/openapi";
import type { OpenAPIV3_1 } from "openapi-types";
import { ArrowSlanted } from "@sumup-oss/icons";
import { Anchor, Body, Button, Card } from "@sumup-oss/circuit-ui";
import { Anchor, Body, Card } from "@sumup-oss/circuit-ui";
import { getJavaSdkVersion } from "@lib/sdks/javaSdkVersion";
import Table from "@components/content/Table";
import Example from "./Example.astro";
Expand Down Expand Up @@ -44,18 +45,16 @@ const sectionAttrs = (id: ApiTopSection) =>
target="_blank"
rel="noreferrer noopener"
icon={ArrowSlanted}
>
View YAML spec
</Button>
label="View YAML spec"
/>
<Button
size="s"
href="https://raw.githubusercontent.com/sumup/sumup-openapi/refs/heads/main/openapi.json"
target="_blank"
rel="noreferrer noopener"
icon={ArrowSlanted}
>
View JSON spec
</Button>
label="View JSON spec"
/>
</div>
</div>
{
Expand Down
17 changes: 17 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {
Button as CircuitButton,
I18nProvider,
type ButtonProps,
} from "@sumup-oss/circuit-ui";

// Astro renders each React component as a separate root, so buttons used in
// Astro templates need their own Circuit UI internationalization context.
type Props = Omit<ButtonProps, "children"> & { label: string };

export default function Button({ label, ...props }: Props) {
return (
<I18nProvider locale="en-US">
<CircuitButton {...props}>{label}</CircuitButton>
</I18nProvider>
);
}
9 changes: 6 additions & 3 deletions src/components/ContactForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Anchor,
Body,
ButtonGroup,
I18nProvider,
ToastProvider,
useNotificationToast,
type SelectOption,
Expand Down Expand Up @@ -273,9 +274,11 @@ const Contact: FC<ContactParams> = ({ status }) => {

export default function ContactForm(params: ContactParams) {
return (
<ToastProvider>
<Contact {...params} />
</ToastProvider>
<I18nProvider locale="en-US">
<ToastProvider>
<Contact {...params} />
</ToastProvider>
</I18nProvider>
);
}

Expand Down
18 changes: 18 additions & 0 deletions src/components/RssIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { IconProps } from "@sumup-oss/icons";

export default function RssIcon({ size = "16", ...props }: IconProps) {
return (
<svg
{...props}
fill="currentColor"
height={size}
width={size}
viewBox="-271 273 256 256"
aria-hidden="true"
>
<path d="M-271,360v48.9c31.9,0,62.1,12.6,84.7,35.2c22.6,22.6,35.1,52.8,35.1,84.8v0.1h49.1c0-46.6-19-88.7-49.6-119.4C-182.2,379-224.4,360.1-271,360z" />
<path d="M-237,460.9c-9.4,0-17.8,3.8-24,10s-10,14.6-10,24c0,9.3,3.8,17.7,10,23.9c6.2,6.1,14.6,9.9,24,9.9s17.8-3.7,24-9.9s10-14.6,10-23.9c0-9.4-3.8-17.8-10-24C-219.2,464.7-227.6,460.9-237,460.9z" />
<path d="M-90.1,348.1c-46.3-46.4-110.2-75.1-180.8-75.1v48.9C-156.8,322-64.1,414.9-64,529h49C-15,458.4-43.7,394.5-90.1,348.1z" />
</svg>
);
}
36 changes: 19 additions & 17 deletions src/components/content/SearchableTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SearchInput } from "@sumup-oss/circuit-ui";
import { I18nProvider, SearchInput } from "@sumup-oss/circuit-ui";
import { useMemo, useRef, useState } from "react";

import styles from "./SearchableTable.module.css";
Expand Down Expand Up @@ -44,23 +44,25 @@ const SearchableTable = ({
}, [columns, normalizedQuery, rows]);

return (
<section className={`${styles.section} not-content`}>
<SearchInput
label="Search"
value={searchQuery}
onChange={(event) => setSearchQuery(event.target.value)}
placeholder={searchPlaceholder}
hideLabel
/>
<I18nProvider locale="en-US">
<section className={`${styles.section} not-content`}>
<SearchInput
label="Search"
value={searchQuery}
onChange={(event) => setSearchQuery(event.target.value)}
placeholder={searchPlaceholder}
hideLabel
/>

<Table
columns={columns}
rows={filteredRows}
tableLayout={tableLayout}
containerRef={wrapperRef}
maxHeight="420px"
/>
</section>
<Table
columns={columns}
rows={filteredRows}
tableLayout={tableLayout}
containerRef={wrapperRef}
maxHeight="420px"
/>
</section>
</I18nProvider>
);
};

Expand Down
8 changes: 4 additions & 4 deletions src/overrides/PageTitle.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import { Display, Body, Button } from "@sumup-oss/circuit-ui";
import Button from "@components/Button";
import { Display, Body } from "@sumup-oss/circuit-ui";
import { ArrowSlanted } from "@sumup-oss/icons";

const {
Expand Down Expand Up @@ -40,9 +41,8 @@ const linkItems = Array.isArray(links) ? links : [];
rel={isExternal ? "noreferrer noopener" : undefined}
icon={isExternal ? ArrowSlanted : undefined}
className="page-link"
>
<span>{link.title}</span>
</Button>
label={link.title}
/>
);
})}
</div>
Expand Down
49 changes: 9 additions & 40 deletions src/pages/changelog/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
import Button from "@components/Button";
import RssIcon from "@components/RssIcon";
import { getCollection, render } from "astro:content";
import slugify from "@sindresorhus/slugify";
import { Status, Body, Button, Anchor, Headline } from "@sumup-oss/circuit-ui";
import { Status, Body, Anchor, Headline } from "@sumup-oss/circuit-ui";
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro";
import MarkdownContent from "@components/MarkdownContent.astro";
import type { StarlightPageProps } from "@astrojs/starlight/props";
Expand Down Expand Up @@ -57,35 +59,12 @@ const props = {
</ul>
</div>
<div class="rssSubscribe">
<Button size="s" href="/changelog/rss.xml">
<span class="rssButtonContent">
<svg
fill="currentColor"
height="14px"
width="14px"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="-271 273 256 256"
xml:space="preserve"
>
<g>
<path
d="M-271,360v48.9c31.9,0,62.1,12.6,84.7,35.2c22.6,22.6,35.1,52.8,35.1,84.8v0.1h49.1c0-46.6-19-88.7-49.6-119.4
C-182.2,379-224.4,360.1-271,360z"
></path>
<path
d="M-237,460.9c-9.4,0-17.8,3.8-24,10s-10,14.6-10,24c0,9.3,3.8,17.7,10,23.9c6.2,6.1,14.6,9.9,24,9.9s17.8-3.7,24-9.9
s10-14.6,10-23.9c0-9.4-3.8-17.8-10-24C-219.2,464.7-227.6,460.9-237,460.9z"
></path>
<path
d="M-90.1,348.1c-46.3-46.4-110.2-75.1-180.8-75.1v48.9C-156.8,322-64.1,414.9-64,529h49C-15,458.4-43.7,394.5-90.1,348.1z"
></path>
</g>
</svg>
Subscribe to RSS
</span>
</Button>
<Button
size="s"
href="/changelog/rss.xml"
icon={RssIcon}
label="Subscribe to RSS"
/>
</div>
<main class="content">
{
Expand Down Expand Up @@ -204,14 +183,4 @@ const props = {
display: flex;
justify-content: center;
}

.rssButtonContent {
display: inline-flex;
align-items: center;
gap: var(--cui-spacings-byte);
}

.rssIcon {
flex-shrink: 0;
}
</style>
39 changes: 9 additions & 30 deletions src/pages/changelog/tags/[tag].astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
import Button from "@components/Button";
import RssIcon from "@components/RssIcon";
import { getCollection, render } from "astro:content";
import slugify from "@sindresorhus/slugify";
import { Status, Body, Button, Anchor, Headline } from "@sumup-oss/circuit-ui";
import { Status, Body, Anchor, Headline } from "@sumup-oss/circuit-ui";
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro";
import MarkdownContent from "@components/MarkdownContent.astro";
import type { StarlightPageProps } from "@astrojs/starlight/props";
Expand Down Expand Up @@ -79,35 +81,12 @@ const props = {
</ul>
</div>
<div class="rssSubscribe">
<Button size="s" href="/changelog/rss.xml">
<span class="rssButtonContent">
<svg
fill="currentColor"
height="14px"
width="14px"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="-271 273 256 256"
xml:space="preserve"
>
<g>
<path
d="M-271,360v48.9c31.9,0,62.1,12.6,84.7,35.2c22.6,22.6,35.1,52.8,35.1,84.8v0.1h49.1c0-46.6-19-88.7-49.6-119.4
C-182.2,379-224.4,360.1-271,360z"
></path>
<path
d="M-237,460.9c-9.4,0-17.8,3.8-24,10s-10,14.6-10,24c0,9.3,3.8,17.7,10,23.9c6.2,6.1,14.6,9.9,24,9.9s17.8-3.7,24-9.9
s10-14.6,10-23.9c0-9.4-3.8-17.8-10-24C-219.2,464.7-227.6,460.9-237,460.9z"
></path>
<path
d="M-90.1,348.1c-46.3-46.4-110.2-75.1-180.8-75.1v48.9C-156.8,322-64.1,414.9-64,529h49C-15,458.4-43.7,394.5-90.1,348.1z"
></path>
</g>
</svg>
Subscribe to RSS
</span>
</Button>
<Button
size="s"
href="/changelog/rss.xml"
icon={RssIcon}
label="Subscribe to RSS"
/>
</div>
<main class="content">
{
Expand Down
Loading