File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
22import CatFromAxios from '../Interfaces/CatFromAxios' ;
33import Card from './Styling/Card' ;
4+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
5+ import { faPenToSquare } from '@fortawesome/free-solid-svg-icons' ;
46
57interface Props {
68 cat : CatFromAxios ;
79 setSelectedCat : React . Dispatch < React . SetStateAction < CatFromAxios | null > > ;
810}
911
10- export default function CatCard ( { cat } : Props ) {
12+ export default function CatCard ( { cat, setSelectedCat } : Props ) {
1113 return (
1214 < Card heading = { cat . name } >
13- < div className = "flex justify-between" >
14- < img src = { cat . picture_url ?? '' } alt = { cat . name } className = "w-20" />
15+ < div className = "flex justify-between h-10 sm:h-32" >
16+ < img
17+ src = { cat . picture_url ?? '' }
18+ alt = { cat . name }
19+ className = "w-10 h-10 sm:w-32 sm:h-32"
20+ />
1521 < div >
1622 < p > Level: { cat . battle_profile . level . toString ( ) } </ p >
1723 < p > XP: { cat . battle_profile . xp . toString ( ) } </ p >
1824 </ div >
1925 < p > { cat . description ?? 'A good kitty' } </ p >
26+ < FontAwesomeIcon
27+ className = "h-full"
28+ icon = { faPenToSquare }
29+ onClick = { ( ) => {
30+ setSelectedCat ( cat ) ;
31+ } }
32+ />
2033 </ div >
2134 </ Card >
2235 ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,11 @@ export default function MyClowder() {
2222 }
2323 } , [ userId ] ) ;
2424
25- return (
25+ return selectedCat ? (
26+ < ModalPopover >
27+ < CatProfile > </ CatProfile >
28+ </ ModalPopover >
29+ ) : (
2630 < >
2731 < H2 > My Clowder</ H2 >
2832 < ul >
@@ -32,11 +36,6 @@ export default function MyClowder() {
3236 </ li >
3337 ) ) }
3438 </ ul >
35- { selectedCat && (
36- < ModalPopover >
37- < CatProfile > </ CatProfile >
38- </ ModalPopover >
39- ) }
4039 </ >
4140 ) ;
4241}
You can’t perform that action at this time.
0 commit comments