Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/src/components/MapControls/MapControls.jsx

    rd565449 r0c6b92a  
    1 import React, { useState } from "react";
     1import React, {useEffect, useState} from "react";
    22import styles from "./MapControls.module.css";
    33import plusIcon from "../../assets/plus_icon.png";
    44import minusIcon from "../../assets/minus_icon.png";
    55import floorIcon from "../../assets/floor_icon.png";
     6import HttpService from "../../scripts/net/HttpService.js";
    67
    7 export default function MapControls({ onZoomIn, onZoomOut, onFloorChange }) {
    8   const [currentFloor, setCurrentFloor] = useState(1); // Starting floor
     8export default function MapControls({onFloorChange,mapName }) {
     9  const [currentFloor, setCurrentFloor] = useState(0);
     10  const [floors, setFloors] = useState([]);
     11
     12  // Starting floor
    913
    1014  // Handle floor selection
     
    2024      {/* Zoom Controls */}
    2125      <div className={styles.zoomControls}>
    22         <button onClick={onZoomIn} className={styles.zoomButton}>
     26        <button className={styles.zoomButton}>
    2327          <img src={plusIcon} alt="Zoom In" />
    2428        </button>
    25         <button onClick={onZoomOut} className={styles.zoomButton}>
     29        <button className={styles.zoomButton}>
    2630          <img src={minusIcon} alt="Zoom Out" />
    2731        </button>
     
    2933
    3034      {/* Floor Selector */}
    31       <div className={styles.floorSelector}>
    32         <img src={floorIcon} alt="Floor Icon" className={styles.floorIcon} />
    33         <select
    34           value={currentFloor}
    35           onChange={(e) => handleFloorChange(parseInt(e.target.value, 10))}
    36           className={styles.floorDropdown}
    37         >
    38           <option value={1}>1F</option>
    39           <option value={2}>2F</option>
    40           <option value={3}>3F</option>
    41           <option value={4}>4F</option>
    42         </select>
    43       </div>
     35      {/*<div className={styles.floorSelector}>*/}
     36      {/*  <img src={floorIcon} alt="Floor Icon" className={styles.floorIcon} />*/}
     37      {/*  <select*/}
     38      {/*    value={currentFloor}*/}
     39      {/*    onChange={(e) => handleFloorChange(parseInt(e.target.value, 10))}*/}
     40      {/*    className={styles.floorDropdown}*/}
     41      {/*  >*/}
     42      {/*    {floors?.map(floor => (*/}
     43      {/*        <option key={floor.floorNumber} value={floor.floorNumber}>*/}
     44      {/*          {floor.floorNumber}F*/}
     45      {/*        </option>*/}
     46
     47      {/*    ))}*/}
     48      {/*    /!*<option value={1}>1F</option>*!/*/}
     49      {/*    /!*<option value={2}>2F</option>*!/*/}
     50      {/*    /!*<option value={3}>3F</option>*!/*/}
     51      {/*    /!*<option value={4}>4F</option>*!/*/}
     52      {/*  </select>*/}
     53      {/*</div>*/}
    4454    </div>
    4555  );
Note: See TracChangeset for help on using the changeset viewer.