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
17 changes: 11 additions & 6 deletions .github/workflows/frontend-visual-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,27 @@ jobs:
with:
node-version: 20

- name: Cache npm dependencies
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10

- name: Cache pnpm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('frontend/package.json') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-pnpm-

- name: Install dependencies
run: npm install
run: pnpm install --frozen-lockfile

- name: Install Playwright browser
run: npx playwright install --with-deps chromium

- name: Run visual regression tests
run: npm run test:visual:update
run: pnpm run test:visual:update

- name: Commit updated baseline snapshots
run: |
Expand Down
588 changes: 572 additions & 16 deletions frontend/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/public/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/public/workbox-f1770938.js

Large diffs are not rendered by default.

88 changes: 61 additions & 27 deletions frontend/src/app/(authenticated)/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import React, { useState, useEffect } from "react";

import DashboardSkeleton from "@/components/DashboardSkeleton";
import Link from "next/link";
import {
Expand All @@ -12,12 +11,9 @@ import {
import FirstApiKeyModal from "@/components/FirstApiKeyModal";
import PaymentMetrics from "@/components/PaymentMetrics";
import RecentPayments from "@/components/RecentPayments";
import WithdrawModal from "@/components/WithdrawModal";
import FirstPaymentCelebration from "@/components/FirstPaymentCelebration";

export default function DashboardPage() {
const [isFirstKeyModalOpen, setIsFirstKeyModalOpen] = useState(false);
const [isWithdrawOpen, setIsWithdrawOpen] = useState(false);
const hydrated = useMerchantHydrated();
const apiKey = useMerchantApiKey();
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -57,8 +53,18 @@ export default function DashboardPage() {
href="/dashboard/create"
className="group relative flex items-center gap-2.5 overflow-hidden rounded-xl bg-mint px-5 py-3 text-sm font-bold text-black transition-all hover:scale-[1.02] hover:bg-glow"
>
<svg className="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M12 4v16m8-8H4" />
<svg
className="h-5 w-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2.5}
d="M12 4v16m8-8H4"
/>
</svg>
Create Link
<div className="absolute inset-0 -z-10 bg-white/20 opacity-0 transition-opacity group-hover:opacity-100" />
Expand All @@ -68,8 +74,18 @@ export default function DashboardPage() {
href="/docs"
className="flex items-center gap-2.5 rounded-xl border border-white/10 bg-white/5 px-5 py-3 text-sm font-medium text-slate-300 transition-all hover:bg-white/10 hover:text-white"
>
<svg className="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" />
<svg
className="h-5 w-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"
/>
</svg>
View Docs
</Link>
Expand All @@ -78,22 +94,27 @@ export default function DashboardPage() {
href="/settings"
className="flex items-center gap-2.5 rounded-xl border border-white/10 bg-white/5 px-5 py-3 text-sm font-medium text-slate-300 transition-all hover:bg-white/10 hover:text-white"
>
<svg className="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<svg
className="h-5 w-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
/>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
/>
</svg>
Settings
</Link>

<button
onClick={() => setIsWithdrawOpen(true)}
className="flex items-center gap-2.5 rounded-xl border border-mint/20 bg-mint/5 px-5 py-3 text-sm font-medium text-mint transition-all hover:bg-mint/10"
>
<svg className="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
</svg>
Withdraw
</button>
</div>
</header>

Expand All @@ -114,14 +135,26 @@ export default function DashboardPage() {
{/* Activity Table Section */}
<section className="flex flex-col gap-6">
<div className="flex items-center justify-between">
<h2 className="text-xl font-semibold text-white">Recent Activity</h2>
<h2 className="text-xl font-semibold text-white">
Recent Activity
</h2>
<Link
href="/payments"
className="group flex items-center gap-1.5 text-sm text-mint hover:text-glow transition-all"
>
View all payments
<svg className="h-4 w-4 transition-transform group-hover:translate-x-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M14 5l7 7-7 7" />
<svg
className="h-4 w-4 transition-transform group-hover:translate-x-1"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M14 5l7 7-7 7"
/>
</svg>
</Link>
</div>
Expand All @@ -131,9 +164,10 @@ export default function DashboardPage() {
</section>
</div>

<FirstApiKeyModal isOpen={isFirstKeyModalOpen} onClose={() => setIsFirstKeyModalOpen(false)} />
<FirstPaymentCelebration />
<WithdrawModal isOpen={isWithdrawOpen} onClose={() => setIsWithdrawOpen(false)} />
<FirstApiKeyModal
isOpen={isFirstKeyModalOpen}
onClose={() => setIsFirstKeyModalOpen(false)}
/>
</div>
);
}
Loading
Loading