Skip to content
Sam Liu edited this page Mar 5, 2021 · 3 revisions

Overview

src/components/Review: holds all components associated with landlord/building reviews.

Component Hierarchy

Review   
     |
      --- Rating

Rating

  • Takes in a rating as a prop.
  • Renders a horizontal list of five heart icons with rating corresponding to the number of filled hearts. All remaining hearts are left unfilled.
type Props = {
  readonly rating: number;
};

Review

  • Takes in info about a review as props.
  • Renders a card showing the rating, date, and corresponding text of a review. The rating is rendered with a Rating component.
  • Responsive sizing is supported by material-ui's grid layout. On desktop, a vertical list of Review components will take up 9/12 of the screen size and resize to take up the full width of the screen on mobile.
type Props = {
  readonly overallRating: number;
  readonly date: Date;
  readonly text: string;
};