-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated package version * Reordered todo stuff * Handling null color values from api * Added additional map for saving color changes * Splitted colors and room assignments * Updated todo * Added last modified filed to loaded tiles * Transmitting back ack request to back-end to store session values * Getting along with whole booking object transmission from API * Skipping cancelled bookings * Aligning booking by id response with API * Aligning booking by name response with API * Updated todo * Fixed bug with reloading clients in booking details * Updated navlinks for booking details and client card * Updated todo * Booking can be generic * Handling case when client data is included in booking response * Loading client cards with booking data included * Removed booking-short endpoint * Added booking id to client-by-tile request * Enhanced client search experience by splitting search requests into periods of search * Updated todo * Handled html entities in data from API * Updated todo * Using post to request police and istat data publication * Added download ricevuta button * Removed entity from tile data * Added province of birth * Updated readme Co-authored-by: Daniil Ryzhkov <drop.sovet@gmail.com>
- Loading branch information
Showing
37 changed files
with
765 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { memo, useMemo } from "react"; | ||
|
||
import { Booking, Client, Tile } from "../../api"; | ||
import { TileColor, TileData } from "../../redux/tilesSlice"; | ||
|
||
import ExpandableTile from "../ExpandableTile"; | ||
import { TileContext } from "../Tile/context"; | ||
import { BookingDetailsContext } from "./context"; | ||
|
||
export type StayDetailsProps = { | ||
booking: Booking<Client[]>, | ||
tile: Tile<Client[]>, | ||
isFirst: boolean | ||
} | ||
|
||
export default memo(function StayDetails(props: StayDetailsProps): JSX.Element { | ||
const { booking, tile, isFirst } = props; | ||
|
||
|
||
const el = useMemo(() => { | ||
const tileData: TileData = { | ||
id: tile.id, | ||
bookingId: booking.id, | ||
name: booking.name, | ||
from: tile.from, | ||
nights: tile.nights, | ||
roomType: tile.roomType, | ||
persons: tile.persons.length, | ||
color: booking.color ?? `booking${Math.floor(Math.random() * 7) + 1}` as TileColor, | ||
roomId: tile.roomId | ||
}; | ||
|
||
return ( | ||
<BookingDetailsContext.Provider value={{ clients: tile.persons }}> | ||
<TileContext.Provider value={{ data: tileData, cropRight: false, cropLeft: false }}> | ||
<ExpandableTile variant="in-content" isFirst={isFirst} /> | ||
</TileContext.Provider> | ||
</BookingDetailsContext.Provider> | ||
); | ||
}, [tile, booking, isFirst]); | ||
return el; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createContext } from "react"; | ||
|
||
import { Client } from "../../api"; | ||
|
||
export const BookingDetailsContext = createContext<{ | ||
clients: Client[] | ||
}>({ | ||
clients: [] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.