This document provides an overview of the components used in the AidLink application.
A versatile button component with multiple variants and sizes.
Props:
variant: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'size: 'default' | 'sm' | 'lg' | 'icon'asChild: booleandisabled: boolean
Usage:
<Button variant="primary" size="lg">
Click me
</Button>A container component with header, content, and footer sections.
Components:
Card: Main containerCardHeader: Header sectionCardTitle: Title textCardDescription: Description textCardContent: Main content areaCardFooter: Footer section
Usage:
<Card>
<CardHeader>
<CardTitle>Title</CardTitle>
<CardDescription>Description</CardDescription>
</CardHeader>
<CardContent>
Content here
</CardContent>
</Card>A text input component with various types.
Props:
type: 'text' | 'number' | 'email' | 'password' | etc.placeholder: stringdisabled: booleanvalue: stringonChange: function
Usage:
<Input
type="text"
placeholder="Enter text"
value={value}
onChange={(e) => setValue(e.target.value)}
/>A small label component for status indicators.
Props:
variant: 'default' | 'secondary' | 'destructive' | 'outline'
Usage:
<Badge variant="secondary">Status</Badge>A table component with header, body, and footer.
Components:
Table: Main containerTableHeader: Header sectionTableBody: Body sectionTableFooter: Footer sectionTableRow: Row componentTableHead: Header cellTableCell: Data cell
Usage:
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>John</TableCell>
<TableCell>Active</TableCell>
</TableRow>
</TableBody>
</Table>A tabbed interface component.
Components:
Tabs: Main containerTabsList: Tab listTabsTrigger: Individual tab triggerTabsContent: Tab content panel
Usage:
<Tabs defaultValue="tab1">
<TabsList>
<TabsTrigger value="tab1">Tab 1</TabsTrigger>
<TabsTrigger value="tab2">Tab 2</TabsTrigger>
</TabsList>
<TabsContent value="tab1">Content 1</TabsContent>
<TabsContent value="tab2">Content 2</TabsContent>
</Tabs>A modal dialog component.
Components:
Dialog: Main containerDialogTrigger: Trigger buttonDialogContent: Dialog contentDialogHeader: Header sectionDialogTitle: Title textDialogDescription: Description textDialogFooter: Footer section
Usage:
<Dialog>
<DialogTrigger>Open</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Title</DialogTitle>
<DialogDescription>Description</DialogDescription>
</DialogHeader>
Content
</DialogContent>
</Dialog>A loading placeholder component.
Usage:
<Skeleton className="h-4 w-[250px]" />A component for displaying empty states.
Props:
icon: LucideIcontitle: stringdescription: stringaction: { label: string, onClick: function }
Usage:
<EmptyState
icon={Heart}
title="No campaigns found"
description="Create your first campaign to get started"
action={{ label: "Create Campaign", onClick: () => {} }}
/>A component for catching and displaying errors.
Usage:
<ErrorBoundary>
<YourComponent />
</ErrorBoundary>Main navigation component with wallet connection status.
Location: src/components/layout/navigation.tsx
Features:
- Responsive design
- Wallet connection status
- Mobile menu
- Network switching
Public landing page with hero, features, and CTAs.
Location: src/components/features/landing/landing-page.tsx
Features:
- Hero section
- Feature cards
- Statistics display
- Call-to-action buttons
- Animations with Framer Motion
Main navigation bar component.
Features:
- Logo and branding
- Navigation links
- Wallet connection button
- Mobile responsive menu
Hook for wallet connection and management.
Location: src/hooks/use-wallet.ts
Returns:
useConnectWallet: Mutation for connecting walletuseDisconnectWallet: Mutation for disconnecting walletuseSwitchNetwork: Mutation for switching networks
Hook for contract interactions.
Location: src/hooks/use-contract.ts
Returns:
useBalance: Query for wallet balanceuseContractInvoke: Mutation for contract invocationuseTransactionSubmit: Mutation for transaction submissionuseTransactionStatus: Query for transaction status
Zustand store for wallet state.
Location: src/store/wallet-store.ts
State:
isConnected: booleanaddress: string | nullpublicKey: string | nullnetwork: 'mainnet' | 'testnet' | 'futurenet' | 'standalone'balance: string
Actions:
setWallet: Update wallet statedisconnect: Disconnect walletswitchNetwork: Switch network
Zustand store for UI state.
Location: src/store/ui-store.ts
State:
sidebarOpen: booleantheme: 'light' | 'dark' | 'system'
Actions:
setSidebarOpen: Toggle sidebartoggleSidebar: Toggle sidebarsetTheme: Set theme
Utility function for merging Tailwind CSS classes.
Location: src/lib/utils.ts
Usage:
cn('base-class', 'additional-class', condition && 'conditional-class')Format wallet address for display.
Location: src/lib/utils.ts
Usage:
formatAddress('GB5XWAMU7QNOZBU4K7L5KGK46XB5HQDJC7W3COSKZQD5NVD4M7Y4Q2K7')
// Returns: 'GB5X...Q2K7'Format numbers for display.
Location: src/lib/utils.ts
Usage:
formatAmount(1234.5678, 2)
// Returns: '1,234.57'Format dates for display.
Location: src/lib/utils.ts
Usage:
formatDate(new Date())
// Returns: 'May 18, 2026'Stellar blockchain integration layer.
Location: src/lib/soroban/sdk.ts
Methods:
getAccount: Fetch account detailsgetBalance: Fetch account balanceinvokeContract: Invoke smart contract methodsubmitTransaction: Submit transaction to networkgetTransactionStatus: Get transaction status
Usage:
import { sorobanSDK } from '@/lib/soroban/sdk'
const balance = await sorobanSDK.getBalance(accountId)
const result = await sorobanSDK.invokeContract(contractId, 'donate', [amount])- Place components in appropriate directories
- Use TypeScript for type safety
- Add JSDoc comments for complex logic
- Make components reusable
- Follow existing naming conventions
import { Button } from '@/components/ui/button'
import { cn } from '@/lib/utils'
interface MyComponentProps {
title: string
description?: string
className?: string
}
export function MyComponent({ title, description, className }: MyComponentProps) {
return (
<div className={cn('p-4', className)}>
<h2 className="text-xl font-bold">{title}</h2>
{description && <p className="text-muted-foreground">{description}</p>}
</div>
)
}import { render, screen } from '@testing-library/react'
import { Button } from '@/components/ui/button'
describe('Button', () => {
it('renders correctly', () => {
render(<Button>Click me</Button>)
expect(screen.getByText('Click me')).toBeInTheDocument()
})
})import { render, screen, fireEvent } from '@testing-library/react'
import { Navigation } from '@/components/layout/navigation'
describe('Navigation', () => {
it('navigates to dashboard when wallet connected', () => {
render(<Navigation />)
// Test navigation logic
})
})