DAO Components
Custom components for Agora DAO functionality located inapp/_components/.
DaoSetup
Handles DAO session initialization and redirects based on stored DAO address. Location:app/_components/DaoSetup.tsx
Usage:
- Checks localStorage for existing DAO address
- Redirects to
/daosif no DAO is selected - Shows/hides header based on DAO state
- Displays loading spinner during transitions
useDaoStore- DAO state managementuseHeaderStore- Header visibility controlLOCAL_STORAGE_KEYS- localStorage key constants
HeroSection
Landing page hero with animated text and wallet connection. Location:app/_components/HeroSection.tsx
Usage:
- Animated badge with
DecryptedTexteffect - Rotating text showcasing DAO features
- Auto-redirect to
/daoswhen wallet connects - RainbowKit connect button integration
useAccount hook internally)
FeatureSection
Displays main DAO features in a grid layout. Location:app/_components/FeatureSection.tsx
Usage:
- Server-side component (async)
- Three main features: Transparent Voting, Gamified Tasks, Reward System
- Card-based layout with icons
- Hover effects for better UX
This is a server component (
"use server"). It cannot use client-side hooks.Scaffold-ETH Components
Reusable blockchain components from Scaffold-ETH toolkit.Address
Displays Ethereum addresses with ENS resolution and blockie avatars. Location:components/scaffold-eth/Address/Address.tsx
Usage:
Ethereum address to display
Disable block explorer link
Display format:
short: 0x1234…5678long: Full address
Component size affecting text and avatar
Show only ENS name or address (no dual display)
- Automatic ENS name resolution
- ENS avatar display
- Blockie avatar fallback
- Copy to clipboard functionality
- Block explorer link integration
- Loading states with skeleton UI
Balance
Displays wallet balance with USD conversion toggle. Location:components/scaffold-eth/Balance.tsx
Usage:
Wallet address to display balance for
Additional CSS classes
Initial display mode (ETH or USD)
- Real-time balance watching
- Click to toggle between native currency and USD
- Automatic price fetching
- Loading skeleton
- Error handling
AddressInput
Input field for Ethereum addresses with ENS resolution. Location:components/scaffold-eth/Input/AddressInput.tsx
Usage:
Current input value
Callback when value changes
Input field name
Placeholder text
Disable input
- ENS to address resolution
- Address to ENS reverse lookup
- ENS avatar display
- Blockie preview
- Debounced ENS lookups (500ms)
- Error states for invalid addresses
- Loading indicators
RainbowKitCustomConnectButton
Custom-styled wallet connection button. Location:components/scaffold-eth/RainbowKitCustomConnectButton/index.tsx
Usage:
- Custom “Conectar Wallet” button text
- Balance display when connected
- Network name with color coding
- Wrong network detection and switching
- Address dropdown with QR code
- Block explorer link
- Fully styled to match Agora DAO theme
ScaffoldHeader
Main navigation header with wallet connection. Location:components/ScaffoldHeader.tsx
Usage:
- Responsive navigation (mobile sidebar toggle)
- Active route highlighting
- Menu links: Home, Tasks, Configuration, Debug, Logout
- Logo with site title
- RainbowKit integration
- Faucet button (local networks only)
- Controlled visibility via
useHeaderStore
UI Components
Custom UI components with animations.DecryptedText
Animated text with scrambling/decryption effect. Location:components/ui/DecryptedText.tsx
Usage:
Text to display and animate
Animation speed in milliseconds
Number of scramble iterations (non-sequential mode)
Reveal characters one by one
Direction to reveal characters in sequential mode
Trigger animation on viewport intersection or hover
Use only characters from original text when scrambling
Character set for scrambling effect
RotatingText
Rotates through multiple text strings with animation. Location:components/ui/RotatingText.tsx
Usage:
Array of texts to rotate through
Milliseconds between text changes
Character animation stagger direction
CSS classes for main container
CSS classes for individual text elements
ShadCN UI Components
The project uses shadcn/ui components:- Button -
components/ui/shadcn/button.tsx - Card -
components/ui/shadcn/card.tsx - Badge -
components/ui/shadcn/badge.tsx - Input -
components/ui/shadcn/input.tsx - Select -
components/ui/shadcn/select.tsx - Dialog -
components/ui/shadcn/dialog.tsx - Form -
components/ui/shadcn/form.tsx - Table -
components/ui/shadcn/table.tsx - And many more…