Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions frontend/src/components/Apartment/AptInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ type Props = {
readonly longitude?: number;
};

/**
* AptInfo – Displays landlord information and other properties owned by the landlord.
*
* @remarks
* This component combines landlord contact information with a list of other properties
* they own. It is used on the apartment page to provide context about the landlord.
*
* @param {string | null} props.landlordId – The unique identifier for the landlord.
* @param {string} props.landlord – The name of the landlord or renting company.
* @param {string | null} props.contact – Contact URL for the landlord.
* @param {string | null} props.address – The address of the apartment.
* @param {CardData[]} props.buildings – List of other properties owned by the landlord.
*
* @return {ReactElement} – The rendered AptInfo component.
*/
export default function AptInfo({
landlordId,
landlord,
Expand Down
21 changes: 21 additions & 0 deletions frontend/src/components/Apartment/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,33 @@ type Props = {
readonly address: string | null;
};

/**
* InfoItem – Renders a single list item displaying text information.
*
* @param {string} props.text – The text content to display.
*
* @return {JSX.Element} – A ListItem component with the text.
*/
const InfoItem = ({ text }: { text: string }) => (
<ListItem disableGutters>
<ListItemText primary={text} />
</ListItem>
);

/**
* Info – Displays landlord contact information with links to their page and contact.
*
* @remarks
* This component shows the landlord name and address, with buttons to visit
* the landlord's page or contact them directly.
*
* @param {string | null} props.landlordId – The unique identifier for the landlord.
* @param {string | null} props.landlord – The name of the landlord or renting company.
* @param {string | null} props.contact – Contact URL for the landlord.
* @param {string | null} props.address – The address of the apartment.
*
* @return {ReactElement} – The rendered Info component.
*/
export default function Info({ landlordId, landlord, contact, address }: Props): ReactElement {
const { title } = useStyles();

Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/Apartment/MapInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
walkDistance: number | undefined;
};

/**
* WalkDistanceInfo – Displays walking distance to a campus location.
*
* @param {string} props.location – The name of the campus location.
* @param {number | undefined} props.walkDistance – Walking time in minutes.
*
* @return {JSX.Element} – A row showing the location and walk time.
*/
const WalkDistanceInfo = ({ location, walkDistance }: distanceProps) => {
return (
<div>
Expand Down Expand Up @@ -171,7 +179,7 @@
mapRef.current.setZoom(defaultZoom);
setMarkerSize(defaultMarkerSize);
}
}, [mapToggle, latitude, longitude]);

Check warning on line 182 in frontend/src/components/Apartment/MapInfo.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has missing dependencies: 'defaultMarkerSize' and 'defaultZoom'. Either include them or remove the dependency array

const handleZoom = (zoomChange: number) => {
if (mapRef.current) {
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/ApartmentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import savedIcon from '../assets/saved-icon-filled.svg';
import unsavedIcon from '../assets/saved-icon-unfilled.svg';
import MapModal from '../components/Apartment/MapModal';
import DropDownWithLabel from '../components/utils/DropDownWithLabel';
import firebase from 'firebase/app';
import 'firebase/auth';

type Props = {
user: firebase.User | null;
Expand Down
Loading