Changeset 07f4e8b for frontend/src/Components/Resources/ResourcesTab.js
- Timestamp:
- 01/24/24 17:42:28 (5 months ago)
- Branches:
- master
- Children:
- 0f5aa27
- Parents:
- 5528b99
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Resources/ResourcesTab.js
r5528b99 r07f4e8b 10 10 11 11 function ResourcesTab(props) { 12 <<<<<<< HEAD13 12 const [activeTab, setActiveTab] = useState(props.tab); 14 13 const userId = JSON.parse(localStorage.getItem("user")).userId; … … 36 35 <Nav.Item className="tab_item rounded-5"> 37 36 <Nav.Link href="/resources/hotel" className="text-left rounded-5"> 38 =======39 const [activeTab, setActiveTab] = useState(props.tab);40 // const [changed, setChanged] = useState(0);41 const userId = localStorage.getItem("userId");42 const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`);43 44 const handleSelect = (eventKey) => {45 setActiveTab(eventKey);46 console.log(props.refresh);47 props.refresh(eventKey);48 console.log("refresh" + eventKey);49 };50 51 !isLoading && console.log(data);52 console.log(props.tab);53 54 return (55 <Container className="rounded-5">56 <Tab.Container57 activeKey={activeTab}58 onSelect={handleSelect}59 className="bg-dark rounded-5"60 >61 <Nav62 fill63 variant="tabs"64 className="bg-body rounded-top-5"65 activeKey="/hotel"66 id="tab_item"67 >68 <Nav.Item className="tab_item rounded-5">69 <Nav.Link href="/resources/hotel" className="text-left rounded-5">70 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)71 37 <span className="ikona"> 72 38 <FaHotel … … 101 67 </Nav> 102 68 103 <<<<<<< HEAD104 69 <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light"> 105 70 <Tab.Pane eventKey="/hotel" key="hotelPane"> … … 150 115 </Container> 151 116 ); 152 =======153 <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light">154 <Tab.Pane eventKey="/hotel" key="hotelPane">155 {props.tab == "/hotel" && !isLoading && data != null &&156 data.map((hotel) => {157 return (158 <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>159 <ResourceListing160 key={hotel.hotelId}161 id={hotel.hotelId}162 type="hotel"163 data={hotel}164 />165 </Link>166 );167 })}168 <AddNew type="hotel" refresh={setChanged} />169 </Tab.Pane>170 <Tab.Pane eventKey="/restaurant" key="restaurantPane">171 {props.tab == "/restaurant" && !isLoading && data != null &&172 data.map((restaurant) => {173 console.log("mapiranje " + restaurant)174 return (175 <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>176 <ResourceListing177 key={restaurant.restaurantId}178 type="restaurant"179 data={restaurant}180 />181 </Link>182 );183 })}184 <AddNew type="restaurant" refresh={setChanged}/>185 </Tab.Pane>186 <Tab.Pane eventKey="/transport" key="transportPane">187 {props.tab == "/transport" && !isLoading && data.length > 0 &&188 data.map((transport) => {189 return (190 <ResourceListing191 key={transport.transportId}192 id={transport.transportId}193 type="transport"194 data={transport}195 />196 );197 })}198 <AddNew type="transport" refresh={setChanged}/>199 </Tab.Pane>200 </Tab.Content>201 </Tab.Container>202 </Container>203 );204 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)205 117 } 206 118
Note:
See TracChangeset
for help on using the changeset viewer.