Component Architecture
TUNA is built with React and TypeScript, featuring reusable components for news display, user engagement, and layout. All components follow brutalist design principles with bold borders, shadows, and high contrast.Core Components
NewsCard
Displays news articles with images, metadata, and engagement actions
TipModal
Modal interface for tipping articles with SUI tokens
CommentSection
Full-featured commenting system with wallet authentication
Header & Footer
Navigation, wallet connection, and footer layout components
Component Hierarchy
Design System
Brutalist Style
All components share these design characteristics:- Bold borders: 2-4px solid black borders
- Box shadows: Offset shadows (e.g.,
4px 4px 0 black) - High contrast: Black borders on colored backgrounds
- Sharp corners: No border radius
- Monospace fonts: Used for metadata and labels
Animation
Components use GSAP for animations:- Entrance animations: Fade and slide on scroll
- Hover effects: Lift and shadow changes
- Smooth transitions: 0.2-0.5s durations
Shared Dependencies
Essential Packages
Type Definitions
All components use TypeScript interfaces from/src/types/index.ts:
NewsArticle: Article data structureComment: Comment data structure- Component-specific props interfaces
CSS Methodology
Each component has a dedicated CSS file:NewsCard.cssTipModal.css- Component-specific utility classes
- Global CSS variables for theming
State Management
Local State
Components use React hooks for local state:Global Hooks
Custom hooks from/hooks:
useArticleComments: Fetch article commentsusePostComment: Submit new commentsuseSignAndExecuteTransaction: Execute blockchain transactions
Next Steps
Explore NewsCard
Learn about article display and engagement
Implement Tipping
Add token tipping to your application
