Skip to content

DEV - Address details modal #1960

@ryanfchase

Description

@ryanfchase

Dependency

Overview

We need to create an address details modal that indicates which neighborhood council the pin is located in, or if the pin is not within NC boundaries.

Action Items

  • Create a new Component, AddressDetail

    • File Path: components > Map > AddressDetail.jsx
  • Integrate this component into the Map Component

    • use RequestDetail implementation as a guide
  • The AddressDetails component will need to receive the NC name and the address of the selected location

    • Use Redux to populate the data unless address and NC data can be passed as props
  • Implement logic to render component on click

  • Implement logic to close modal on outside click

  • Implement logic to determine whether or not an address falls within NC boundaries

  • Use MUI components where applicable

    • Adhere to the MUI withStyles styling convention that can be seen in RequestDetail.jsx
  • Implement fade-in on component render

  • DEPENDENCY: Implement logic to notify user when an address outside of a NC has been Selected

  • Optional Document the component with JSDoc

Resources/Instructions

Developer Resources

Request Detail Example Snippets

How to render the component...

<div ref={(el) => (this.requestDetail = el)}>
  <RequestDetail 
    requestId={selectedRequestId} 
    loadingCallback={this.setRequestDetailLoading}
  />
</div>

How to define the Mapbox Popup

addPopup = (coordinates, requestId) => {
  this.setState({ selectedRequestId: requestId });
  this.popup = new mapboxgl.Popup({closeButton: false, anchor: 'left'})
    .setLngLat(coordinates)
    .setDOMContent(this.requestDetail)
    .addTo(this.map);
};

  removePopup = () => {
    if (this.popup) {
      this.popup.remove();
      this.popup = null;
      this.setState({ selectedRequestId: null });
    }
  };

Design Hand Off Materials

Screenshots

Screenshot before proposed changes

PR1959-review-address-outside-bounds

Screenshot of Figma

Zoomed Out

Image

Zoomed In

Image

Screenshot of new feature from localhost

[insert screenshot here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Complexity: Mediumrequire research/investigation before completing; internal team info/input or external team questionDependencyAn issue that includes dependenciesRole: FrontendReact front end workp-feature: address lookupaddress pin, address details modal, address search barsize: 2ptCan be done in 7-12 hours

    Type

    No type

    Projects

    Status

    Icebox (on hold)

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions