From e02376cb793dd343f8ee2aa914d913c48adb53e7 Mon Sep 17 00:00:00 2001 From: Jo D Date: Thu, 30 Apr 2026 10:14:43 -0400 Subject: [PATCH] refactor(webapp): use remaining design system primitives --- webapp/src/components/app-modal.tsx | 5 +- .../delegation/active-delegations.tsx | 31 ++++--- .../delegation/create-delegation-dialog.tsx | 26 +++--- .../components/plan/create-plan-dialog.tsx | 11 +-- .../plan/enhanced-collect-payments.tsx | 82 +++++++++---------- webapp/src/components/plan/plan-card.tsx | 35 ++++---- .../program/program-deploy-card.tsx | 28 +++---- webapp/src/routes/setup.tsx | 24 +++--- 8 files changed, 119 insertions(+), 123 deletions(-) diff --git a/webapp/src/components/app-modal.tsx b/webapp/src/components/app-modal.tsx index f648f77..46376ca 100644 --- a/webapp/src/components/app-modal.tsx +++ b/webapp/src/components/app-modal.tsx @@ -1,3 +1,4 @@ +import { Button as SolanaButton } from '@solana/design-system'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog'; import React from 'react'; @@ -27,9 +28,9 @@ export function AppModal({
{children}
{submit ? ( - + ) : null} diff --git a/webapp/src/components/delegation/active-delegations.tsx b/webapp/src/components/delegation/active-delegations.tsx index 68b5f2b..b8a33c9 100644 --- a/webapp/src/components/delegation/active-delegations.tsx +++ b/webapp/src/components/delegation/active-delegations.tsx @@ -1,5 +1,14 @@ import { RefreshCw, FileX, Coins, ShieldAlert, Power, Trash2 } from 'lucide-react'; -import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@solana/design-system'; +import { + Button as SolanaButton, + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, + TextInput, +} from '@solana/design-system'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -212,12 +221,11 @@ function TransferDelegationButton({ delegation, tokenMint, disabled, blockTime }
- setAmount(e.target.value)} placeholder="0.00" - className="w-full px-3 py-2 rounded-md border border-input bg-background text-sm" />

Available: {availableAmount} USDC

@@ -232,13 +240,13 @@ function TransferDelegationButton({ delegation, tokenMint, disabled, blockTime } - + Transfer + @@ -654,17 +662,18 @@ function InitPrompt({ {!hasAta && !tokenAccountsLoading && (

No token account found. Get some USDC first.

)} - +
); } @@ -748,12 +757,10 @@ function CloseSubscriptionAuthorityDialog({

- setConfirmText(e.target.value)} placeholder="CLOSE" - className="w-full px-3 py-2 rounded-md border border-input bg-background text-sm" />
diff --git a/webapp/src/components/delegation/create-delegation-dialog.tsx b/webapp/src/components/delegation/create-delegation-dialog.tsx index 8cbf5e2..3fdfa05 100644 --- a/webapp/src/components/delegation/create-delegation-dialog.tsx +++ b/webapp/src/components/delegation/create-delegation-dialog.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; import { Coins, RefreshCw, Plus, ArrowLeft } from 'lucide-react'; -import { Select, SelectItem, TextInput } from '@solana/design-system'; +import { Button as SolanaButton, Select, SelectItem, TextInput } from '@solana/design-system'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, DialogFooter } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; @@ -169,13 +169,9 @@ export function CreateDelegationDialog({ tokenMint, disabled }: CreateDelegation return ( - + @@ -204,12 +200,9 @@ export function CreateDelegationDialog({ tokenMint, disabled }: CreateDelegation /> - + ) : ( @@ -330,13 +323,14 @@ export function CreateDelegationDialog({ tokenMint, disabled }: CreateDelegation Back - + Create Delegation + )} diff --git a/webapp/src/components/plan/create-plan-dialog.tsx b/webapp/src/components/plan/create-plan-dialog.tsx index 9732d3b..c2c0897 100644 --- a/webapp/src/components/plan/create-plan-dialog.tsx +++ b/webapp/src/components/plan/create-plan-dialog.tsx @@ -1,6 +1,6 @@ import { useState, useMemo, useEffect } from 'react'; import { X, Plus } from 'lucide-react'; -import { Select, SelectItem, TextInput } from '@solana/design-system'; +import { Button as SolanaButton, Select, SelectItem, TextInput } from '@solana/design-system'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; @@ -453,13 +453,14 @@ export function CreatePlanDialog({ open, onOpenChange }: CreatePlanDialogProps) - + Create Plan + diff --git a/webapp/src/components/plan/enhanced-collect-payments.tsx b/webapp/src/components/plan/enhanced-collect-payments.tsx index 7af24f2..c05f941 100644 --- a/webapp/src/components/plan/enhanced-collect-payments.tsx +++ b/webapp/src/components/plan/enhanced-collect-payments.tsx @@ -1,6 +1,16 @@ import { useState, useMemo, useCallback } from 'react'; -import { DollarSign, Users, ClipboardPen, Loader2, Clock, Star, Banknote, RefreshCw } from 'lucide-react'; -import { Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@solana/design-system'; +import { DollarSign, Users, ClipboardPen, Clock, Star, Banknote, RefreshCw } from 'lucide-react'; +import { + Badge, + Button as SolanaButton, + SegmentedControl, + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '@solana/design-system'; import { toast } from 'sonner'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; @@ -198,20 +208,15 @@ function CollectAllButton({ }, [eligiblePlans, rpcUrl, progAddr, collectAllPlanPayments, onComplete]); return ( - + {collecting + ? progress || 'Collecting...' + : `Collect All Pending ($${totalPendingUsd.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })})`} + ); } @@ -317,43 +322,32 @@ function EnhancedPlanCard({ planData, blockTs }: { planData: PlanSubscriberData; {pendingUsd > 0 && ( ${pendingUsd.toFixed(2)} pending )} - + Collect ${pendingUsd.toFixed(2)} + {expanded && (
-
- - +
+ setView(value as typeof view)} + items={[ + { value: 'subscribers', label: 'Subscribers' }, + { value: 'history', label: 'History' }, + ]} + />
@@ -563,9 +557,15 @@ export function EnhancedCollectPayments() { />
- + } + aria-label="Refresh collections" + onClick={handleRefresh} + disabled={spinning} + /> onOpenChange(false)}> Cancel - + Update Plan + @@ -496,22 +496,21 @@ function SubscribeDialog({
Your SubscriptionAuthority account must be initialized for this token before subscribing.
- + Initialize SubscriptionAuthority +
) : ( - + Subscribe + )} @@ -854,17 +853,17 @@ export function PlanCard({ Already Subscribed ) : ( - + )}
)} diff --git a/webapp/src/components/program/program-deploy-card.tsx b/webapp/src/components/program/program-deploy-card.tsx index 7a4bce9..32b9172 100644 --- a/webapp/src/components/program/program-deploy-card.tsx +++ b/webapp/src/components/program/program-deploy-card.tsx @@ -11,7 +11,7 @@ import { Shield, Send, } from 'lucide-react'; -import { CopyButton, TextInput } from '@solana/design-system'; +import { Button as SolanaButton, CopyButton, TextInput } from '@solana/design-system'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { useProgramStatus } from '@/hooks/use-program-status'; @@ -182,21 +182,15 @@ function TransferAuthoritySection() { {isValidInput && (
{isAuthority && ( - + Sign & Send + )} + )} {(isActive || progress.phase === 'done' || progress.phase === 'error') && ( diff --git a/webapp/src/routes/setup.tsx b/webapp/src/routes/setup.tsx index 61d29f0..766a6ee 100644 --- a/webapp/src/routes/setup.tsx +++ b/webapp/src/routes/setup.tsx @@ -845,14 +845,14 @@ function DevnetWizard({ onComplete, onBack }: { onComplete: () => void; onBack: {phase === 'deploy' && (
- + {programStatus.data?.deployed && programStatus.data?.upgradeAuthority === account && (
@@ -915,14 +915,14 @@ function DevnetWizard({ onComplete, onBack }: { onComplete: () => void; onBack: placeholder="New authority address..." inputClassName="font-mono" /> - +
+ )}