Skip to content

Commit

Permalink
#50 Add traveler page
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraBergstrom committed Jun 28, 2023
1 parent cfd24c7 commit 8cf2d6d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/pages/travelers/Traveler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react'
import styles from '../../styles/TravelerProfile.module.css'
import btnStyles from '../../styles/Button.module.css'
import { useCurrentUser } from '../../contexts/CurrentUserContext'
import { Link } from 'react-router-dom'
import Avatar from '../../components/Avatar'

const Traveler = (props) => {
const {traveler, mobile, imageSize=55} = props
const {id, following_id, image, owner} = traveler;

const currentUser = useCurrentUser();
const is_owner = currentUser?.username === owner;

return (
<div className={`my-3 d-flex align-items-center ${mobile && 'flex-column'}`}>
<div>
<Link className="align-self-center" to={`/travelers/${id}`}>
<Avatar src={image} height={imageSize} />
</Link>
</div>
<div className={`mx-2 ${styles.WordBreak}`}>
<strong>{owner}</strong>

</div>
</div>
)
}

export default Traveler
3 changes: 3 additions & 0 deletions src/styles/TravelerProfile.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.WordBreak {
word-break: break-all;
}

0 comments on commit 8cf2d6d

Please sign in to comment.