Components

LandmarkDetails

<LandmarkDetails />

Constructor

# <LandmarkDetails />

Component that renders the details of a selected Landmark and allows the user to edit those details. Contained within a react-native-modal.

View Source src/components/LandmarkDetails.tsx, line 22

Members

# inner constant renderComment

Renders all comments associated with the selectedLandmark as items for the FlatList in this component.

View Source src/components/LandmarkDetails.tsx, line 103

# inner constant selectedLandmarkState

Holds the state of the Landmark being displayed.

View Source src/components/LandmarkDetails.tsx, line 26

# inner constant updatedLandmarkState

Holds state of a Landmark object parallel to selectedLandmarkState that is manipulated when editingEnabled is true.

View Source src/components/LandmarkDetails.tsx, line 31

Methods

# static resetDeleteMutationOnSuccess()

Resets the deleteLandmark mutation on successful delete. Embedded in a useEffect that listens to the deleteLandmarkStatus value from the useLandmarks hook.

View Source src/components/LandmarkDetails.tsx, line 65

# static resetUpdateMutationOnSuccess()

Resets the updateLandmark mutation on successful add. Embedded in a useEffect that listens to the updateLandmarkStatus value from the useLandmarks hook.

View Source src/components/LandmarkDetails.tsx, line 51

# static updateLandmarkStateFromParent()

Updates this component's selectedLandmarkState when the landmark prop passed down from the parent Map's selectedLandmark is changed. Embedded in a useEffect that listens to the landmark prop.

View Source src/components/LandmarkDetails.tsx, line 40

# async inner editLandmark()

Calls the updateLandmark mutation from the useLandmarks hook and closes the modal once finished.

View Source src/components/LandmarkDetails.tsx, line 87

# async inner removeLandmark()

Calls the deleteLandmark mutation from the useLandmarks hook and closes the modal once finished.

View Source src/components/LandmarkDetails.tsx, line 96

# inner toggleEditing()

Toggles whether or not the selectedLandmark can be edited through the editingEnabled prop.

View Source src/components/LandmarkDetails.tsx, line 75