This is a frontend template for the Charity Dashboard. It is built to be modular and easily connected to a backend API.
- Framework: React 18
- Language: TypeScript
- Styling: Tailwind CSS v4 (configured via Vite plugin)
- Build Tool: Vite
src/types.ts: TypeScript interfaces defining theCharitydata model.src/components/CharityCard.tsx: The UI component for individual items. Handles "Time Ago" logic and dynamic progress circles.src/components/CharityCarousel.tsx: A scrollable container that manages layout and navigation arrows.src/App.tsx: The main entry point containing Mock Data.
-
Data Connection: - Open
src/App.tsx.- Replace the
templateCharitiesarray with a fetch call to your API. - Ensure your API response matches the
Charityinterface insrc/types.ts.
- Replace the
-
Navigation:
- The
CharityCardcomponent accepts an optionalonNavigateprop. Pass your router logic (e.g.,useNavigate) into this prop to handle clicks.
- The
-
Dynamic Dates:
- The
uploadDatefield expects an ISO string (e.g.,"2026-02-02T10:00:00Z"). The card automatically converts this to "X Days Ago".
- The
npm install
npm run dev