Skip to content

Commit

Permalink
#25 Add handleFollow to button
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraBergstrom committed Jun 29, 2023
1 parent 7318944 commit 162276e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/travelers/Traveler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useCurrentUser } from "../../contexts/CurrentUserContext";
import { Link } from "react-router-dom";
import Avatar from "../../components/Avatar";
import { Button } from "react-bootstrap";
import { useSetTravelerData } from "../../contexts/TravelerDataContext";

const Traveler = (props) => {
const { traveler, mobile, imageSize = 55 } = props;
Expand All @@ -13,6 +14,8 @@ const Traveler = (props) => {
const currentUser = useCurrentUser();
const is_owner = currentUser?.username === owner;

const {handleFollow} = useSetTravelerData();

return (
<div
className={`my-3 d-flex align-items-center ${mobile && "flex-column"}`}
Expand All @@ -39,7 +42,7 @@ const Traveler = (props) => {
) : (
<Button
className={`me-1 ${btnStyles.Button} ${btnStyles.PinkOutline}`}
onClick={() => {}}
onClick={() => handleFollow(traveler)}
>
follow
</Button>
Expand Down

0 comments on commit 162276e

Please sign in to comment.