cdmoss 2 лет назад
Родитель
Сommit
575908a017

+ 0 - 4
src/components/Map/MainMapComponent/useMapState.ts

@@ -15,10 +15,6 @@ export const useMapState = () => {
      * State that contains the new {@link Landmark} object which is passed down to the {@link AddLandmark} modal.
      */
     const [newLandmark, setNewLandmark] = useState<Landmark>(undefined);
-    /**
-     * State that contains image data for the location of a new indoor landmark added.
-     */
-     const [indoorLmLocImg, setIndoorLmLocImg] = useState<string>(undefined);
     /**
      * State that contains the selected {@link Landmark} object which is passed down to the {@link LandmarkDetails} modal.
      */

+ 3 - 3
src/components/Map/Panels/AddLandmarkPanel.tsx

@@ -32,7 +32,6 @@ export interface AddLandmarkProps {
      * The {@link landmark} object to be added.
      */
     newLandmark?: Landmark;
-    indoorLmLocImg?: string;
     /**
      * The state updater for the new {@link landmark} to be added.
      */
@@ -49,7 +48,7 @@ export interface AddLandmarkProps {
  * @component
  * @category Map
  */
-const AddLandmarkPanel: React.FC<AddLandmarkProps> = ({newLandmark, setNewLandmark, setVisible, visible, indoorLmLocImg}) => {
+const AddLandmarkPanel: React.FC<AddLandmarkProps> = ({newLandmark, setNewLandmark, setVisible, visible}) => {
     const [photos, setPhotos] = useState<LMPhoto[]>([])
     const [photoSourceMenuOpened, togglePhotoSourceMenu] = useState<boolean>(false)
 
@@ -81,7 +80,8 @@ const AddLandmarkPanel: React.FC<AddLandmarkProps> = ({newLandmark, setNewLandma
      * Calls {@link addLandmarkAsync} from {@link useLandmarks} to initate the process of adding a landmark, then closes the modal.
      */
     const submit = async () => {
-        await addLandmarkAsync({landmarkValue: newLandmark, photos: photos, indoorLmLocImg: indoorLmLocImg});
+        // create svg content here, then pass it to addLandmarkAsync as the value of indoorLmLocImg
+        await addLandmarkAsync({landmarkValue: newLandmark, photos: photos, indoorLmLocImg: undefined }); // pass it in here
         close()
     }