Skip to content

refactor: modularize Pets.tsx component - #605

Open
EricGrill wants to merge 1 commit into
redxzeta:mainfrom
EricGrill:refactor/modularize-pets-component
Open

EricGrill wants to merge 1 commit into
redxzeta:mainfrom
EricGrill:refactor/modularize-pets-component

Conversation

@EricGrill

Copy link
Copy Markdown
Contributor

Summary

  • Extracts the Pets.tsx component into smaller, focused sub-components for better code organization
  • Creates petLinkData.ts for the linkData array and PetLink type
  • Creates AnimalTypeCard.tsx for the reusable card component
  • Creates RandomPet.tsx for the random pet API logic
  • Adds index.ts barrel exports for cleaner imports

Fixes #601

Test plan

  • Build passes (npm run build)
  • All existing tests pass
  • Manual testing to verify the Pets page renders correctly
  • Verify random pet still loads and displays

🤖 Generated with Claude Code

Break down the Pets.tsx component into smaller, focused sub-components:
- petLinkData.ts: Extract linkData array and PetLink type
- AnimalTypeCard.tsx: Extract the card component for animal types
- RandomPet.tsx: Extract the random pet component with API logic
- index.ts: Add barrel exports for cleaner imports

This improves code organization, maintainability, and reusability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Modularize Pets.tsx component

1 participant