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
4 changes: 2 additions & 2 deletions frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StorybookConfig } from '@storybook/nextjs';
import type { StorybookConfig } from '@storybook/nextjs-vite';

const config: StorybookConfig = {
stories: [
Expand All @@ -11,7 +11,7 @@ const config: StorybookConfig = {
'@storybook/addon-a11y',
'@chromatic-com/storybook',
],
framework: '@storybook/nextjs',
framework: '@storybook/nextjs-vite',
staticDirs: ['../public'],
};

Expand Down
16 changes: 8 additions & 8 deletions frontend/app/sandbox/playground/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export default function PlaygroundPage() {
const [loading, setLoading] = useState(false);

const client = new BridgeletClient({
baseUrl: process.env.NEXT_PUBLIC_API_BASE_URL,
apiKey: process.env.NEXT_PUBLIC_API_KEY,
baseUrl: process.env[`NEXT_PUBLIC_API_BASE_URL`],
apiKey: process.env[`NEXT_PUBLIC_API_KEY`],
} as BridgeletClientOptions);

const handleEndpointChange = (endpoint: Endpoint) => {
Expand All @@ -49,18 +49,18 @@ export default function PlaygroundPage() {
let result: unknown;
switch (selected) {
case "getClaimDetails":
result = await client.getClaimDetails(params.token);
result = await client.getClaimDetails(params[`token`] ?? "");
break;
case "createPaymentIntent":
result = await client.createPaymentIntent({
senderPublicKey: params.senderPublicKey,
amountStroops: params.amountStroops,
assetCode: params.assetCode,
senderPublicKey: params[`senderPublicKey`] ?? "",
amountStroops: params[`amountStroops`] ?? "",
assetCode: params[`assetCode`] ?? "",
});
break;
case "redeemClaim":
result = await client.redeemClaim(params.token, {
recipientPublicKey: params.recipientPublicKey,
result = await client.redeemClaim(params[`token`] ?? "", {
recipientPublicKey: params[`recipientPublicKey`] ?? "",
});
break;
}
Expand Down
14 changes: 5 additions & 9 deletions frontend/components/claim-status-card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ export default meta;

type Story = StoryObj<typeof ClaimStatusCard>;

export const Loading: Story = {
args: { status: 'loading' },
};

export const Unclaimed: Story = {
args: { status: 'unclaimed', amount: '100', asset: 'USDC', expiresAt: '2026-07-15T12:00:00Z' },
export const Available: Story = {
args: { status: 'available', amountStroops: '1000000000', assetCode: 'USDC', expiresAt: '2026-07-15T12:00:00Z' },
};

export const Claimed: Story = {
args: { status: 'claimed', amount: '100', asset: 'USDC' },
args: { status: 'claimed' },
};

export const Expired: Story = {
args: { status: 'expired', amount: '50', asset: 'XLM', expiresAt: '2026-06-01T00:00:00Z' },
};
args: { status: 'expired', expiresAt: '2026-06-01T00:00:00Z', supportEmail: 'support@bridgelet.com' },
};
2 changes: 1 addition & 1 deletion frontend/components/claim-status-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function AvailablePanel({
type="button"
onClick={handleClaim}
disabled={claiming}
className="w-full rounded-lg bg-green-600 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-green-700 disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600"
className="w-full rounded-lg bg-green-600 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-green-700 disabled:opacity-60 focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-green-600"
>
{claiming ? 'Claiming…' : 'Claim now'}
</button>
Expand Down
21 changes: 21 additions & 0 deletions frontend/e2e/accessibility.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import AxeBuilder from '@axe-core/playwright';
import { expect, test } from '@playwright/test';

const routes = ['/', '/send', '/claim/example-token'];

test.describe('Accessibility checks', () => {
for (const route of routes) {
test(`has no WCAG 2.1 AA violations on ${route}`, async ({ page }) => {
await page.goto(route);

const results = await new AxeBuilder({ page })
.withTags(['wcag21aa'])
.analyze();

expect(
results.violations,
results.violations.map((violation) => `${violation.id}: ${violation.help}`).join('\n'),
).toEqual([]);
});
}
});
6 changes: 3 additions & 3 deletions frontend/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** SDK base URL. Falls back to the MSW mock server in development. */
export const SDK_URL =
process.env.NEXT_PUBLIC_SDK_URL ??
(process.env.NODE_ENV === 'production' ? '' : 'http://localhost:3000');
process.env[`NEXT_PUBLIC_SDK_URL`] ??
(process.env[`NODE_ENV`] === 'production' ? '' : 'http://localhost:3000');

/**
* Public API key sent as `x-api-key` on SDK requests.
* Leave empty in development — MSW intercepts without auth.
*/
export const API_KEY = process.env.NEXT_PUBLIC_API_KEY ?? '';
export const API_KEY = process.env[`NEXT_PUBLIC_API_KEY`] ?? '';
2 changes: 1 addition & 1 deletion frontend/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Loading
Loading