some css fix and websocket fix for item update
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
|
||||
import "./RoomWidget.css";
|
||||
import { useHotel } from "../HotelContext";
|
||||
import { useHotel } from "../context/HotelContext";
|
||||
import { useState } from "react";
|
||||
export default function RoomWidget({ roomlist }) {
|
||||
|
||||
|
||||
|
||||
|
||||
export default function RoomWidget({}) {
|
||||
|
||||
const { rooms } = useHotel();
|
||||
|
||||
return (
|
||||
<div className="grid">
|
||||
{roomlist.map(room => (
|
||||
<div className="roomGrid">
|
||||
{rooms.map(room => (
|
||||
<RoomCard
|
||||
key={room.id}
|
||||
id = {room.id}
|
||||
@@ -19,8 +24,6 @@ export default function RoomWidget({ roomlist }) {
|
||||
}
|
||||
|
||||
function RoomCard({ number, status ,id}) {
|
||||
|
||||
|
||||
//FIXME: this shouldn't use hotel context, instead : set the state once on load
|
||||
const { updateRoomStatus } = useHotel();
|
||||
const [editing, setEdtiting] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user