hackforla / hackforla/311-data

DEV - Address details modal

Open
#1,960 1 comment 0 reactions 0 assignees View on GitHub
Complexity: Medium Dependency p-feature: address lookup Role: Frontend size: 2pt
Dominant language
JavaScript
Stars
73
Forks
74
PR merge metrics
No merged PRs in 30d

Description

### Dependency

* https://github.com/hackforla/311-data/issues/1896

### 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

* https://docs.mapbox.com/mapbox-gl-js/example/popup-on-click/

* https://mui.com/material-ui/all-components/

* https://mui.com/material-ui/api/fade/

* https://github.com/hackforla/311-data/blob/main/components/common/customHooks/useOutsideClick.js

* https://jsdoc.app/

#### Developer Resources

Request Detail Example Snippets

How to render the component...
```jsx

(this.requestDetail = el)}>


```

How to define the Mapbox Popup

```js
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
- Figma Section: https://www.figma.com/design/eF63O8yIGz2soQ4JJFfyoK/311_Data_UXUI?node-id=16722-4542&t=viKkRgqNWRIVpHrP-4
- Related Design Ticket: https://github.com/hackforla/311-data/issues/1924

#### Screenshots

Screenshot before proposed changes

![PR1959-review-address-outside-bounds](https://github.com/user-attachments/assets/c83520da-d0e7-4142-9e1c-f5d9d0e3818f)

Screenshot of Figma

**Zoomed Out**

![Image](https://github.com/user-attachments/assets/d8a16802-c21b-496b-8287-72542eec4635)

**Zoomed In**

![Image](https://github.com/user-attachments/assets/6c43f819-4d5a-41a5-a9f9-1197b0e8b6e2)

Screenshot of new feature from localhost


[insert screenshot here]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.