chore(angular-react): Migrate ItemComponent to React #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Angular
ItemComponentto React as part of the Angular-to-React migration effort. The original Angular component is a simple presentational component that displays shop items with name, description, price, and a like button.Changes:
ItemComponent.tsxwith TypeScript interface for props (name,description,price,onLike?)@Input()decorators to React propslike()method ashandleLike()event handlerjest.config.js,jest.setup.js)Note: The original Angular component is preserved; this adds the React equivalent in a new
react-componentsdirectory.Review & Testing Checklist for Human
mat-card. Compare the rendered output visually to ensure acceptable appearancemat-iconwith "favorite"; React uses HTML entity❤. Verify the icon looks acceptableonLikecallback addition: The React version adds an optionalonLikeprop callback (enhancement over original). Confirm this is acceptable for the migrationnpm run test:reactto verify all 9 tests pass locallySuggested test plan:
npm run test:reactto execute Jest testsNotes
src/app/shop/infrastructure/react-components/item/to parallel the Angular structureLink to Devin run: https://app.devin.ai/sessions/ef76c9484037444187d936516462a74f
Requested by: @milind-cognition