Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Landlord Redirect Button (Change to Button Style) #350

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions frontend/src/components/Review/Review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,26 +185,38 @@ const ReviewComponent = ({
});
}, [review.landlordId, landlordNotFound]);

/**
* `propertyLandLordLabel - A button redirecting to property/landlord page
*
* @remarks
* This button component is displayed on review cards (seen in bookmarks,
* profile, landlord page) to redirect users to the property/landlord page
* corresponding to that specific review.
*
* @returns A button/label that links to the property/landlord page
* corresponding to that specific review.
*/
const propertyLandlordLabel = () => {
return (
showLabel && (
<>
<Grid style={{ fontWeight: 'bold', marginRight: '5px' }}>
{apt.length > 0 ? 'Property: ' : 'Landlord: '}
</Grid>
<Link
{...{
to: apt.length > 0 ? `/apartment/${review.aptId}` : `/landlord/${review.landlordId}`,
style: {
color: 'black',
textDecoration: 'underline',
paddingBottom: '3px',
},
component: RouterLink,
}}
onClick={handleLinkClick}
>
{apt.length > 0 ? apt[0].name : landlordData ? landlordData.name : ''}
<Button style={{ textTransform: 'none' }}>
<Grid>
<Typography style={{ fontWeight: 'bold', marginRight: '5px' }}>
{apt.length > 0 ? 'Property: ' : 'Landlord: '}
</Typography>
</Grid>
<Typography>
{apt.length > 0 ? apt[0].name : landlordData ? landlordData.name : ''}
</Typography>
</Button>
</Link>
</>
)
Expand Down
Loading