diff --git a/src/Components/CatCard.tsx b/src/Components/CatCard.tsx index ebeda55..171507d 100644 --- a/src/Components/CatCard.tsx +++ b/src/Components/CatCard.tsx @@ -1,21 +1,35 @@ import React from 'react'; import CatFromAxios from '../Interfaces/CatFromAxios'; import Card from './Styling/Card'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faPenToSquare } from '@fortawesome/free-solid-svg-icons'; interface Props { cat: CatFromAxios; + setSelectedCat: React.Dispatch>; } -export default function CatCard({ cat }: Props) { +export default function CatCard({ cat, setSelectedCat }: Props) { return ( -
- {cat.name} +
+ {cat.name}

Level: {cat.battle_profile.level.toString()}

XP: {cat.battle_profile.xp.toString()}

{cat.description ?? 'A good kitty'}

+ { + setSelectedCat(cat); + }} + />
); diff --git a/src/Components/MyClowder.tsx b/src/Components/MyClowder.tsx index 2a63989..5756760 100644 --- a/src/Components/MyClowder.tsx +++ b/src/Components/MyClowder.tsx @@ -10,6 +10,7 @@ import CatCard from './CatCard'; export default function MyClowder() { const { userId } = useContext(UserContext); const [myCats, setMyCats] = useState([]); + const [selectedCat, setSelectedCat] = useState(null); useEffect(() => { if (userId) { @@ -21,21 +22,20 @@ export default function MyClowder() { } }, [userId]); - return ( + return selectedCat ? ( + + + + ) : ( <>

My Clowder

    {myCats.map((cat) => (
  • - +
  • ))}
- {false && ( - - - - )} ); } diff --git a/src/Components/Styling/H3.tsx b/src/Components/Styling/H3.tsx index 737b3a5..240ad28 100644 --- a/src/Components/Styling/H3.tsx +++ b/src/Components/Styling/H3.tsx @@ -5,5 +5,9 @@ interface Props { } export default function H3({ children }: Props) { - return

{children}

; + return ( +

+ {children} +

+ ); }