-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add the "Until" label for current bookings to indicate the end time. 2. Replace the infinite symbol (∞) with the "Infinite" label for better readability. 3. Remove the "Duration" field for infinite upcoming bookings, as it is redundant.
- Loading branch information
Showing
11 changed files
with
111 additions
and
55 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
ngui/ui/src/components/CurrentBooking/AvailableIn/AvailableIn.tsx
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,35 @@ | ||
import KeyValueLabel from "components/KeyValueLabel/KeyValueLabel"; | ||
import { useFormatIntervalDuration } from "hooks/useFormatIntervalDuration"; | ||
import { INTERVAL_DURATION_VALUE_TYPES } from "utils/datetime"; | ||
|
||
type AvailableInProps = { | ||
remained: { | ||
weeks: number; | ||
days: number; | ||
hours: number; | ||
minutes: number; | ||
seconds: number; | ||
milliseconds: number; | ||
}; | ||
}; | ||
|
||
const AvailableIn = ({ remained }: AvailableInProps) => { | ||
const formatInterval = useFormatIntervalDuration(); | ||
|
||
return ( | ||
<KeyValueLabel | ||
keyMessageId="availableIn" | ||
value={formatInterval({ | ||
formatTo: [ | ||
INTERVAL_DURATION_VALUE_TYPES.WEEKS, | ||
INTERVAL_DURATION_VALUE_TYPES.DAYS, | ||
INTERVAL_DURATION_VALUE_TYPES.HOURS, | ||
INTERVAL_DURATION_VALUE_TYPES.MINUTES | ||
], | ||
duration: remained | ||
})} | ||
/> | ||
); | ||
}; | ||
|
||
export default AvailableIn; |
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,3 @@ | ||
import AvailableIn from "./AvailableIn"; | ||
|
||
export default AvailableIn; |
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
29 changes: 0 additions & 29 deletions
29
ngui/ui/src/components/UpcomingBooking/BookingTimeMeasure/BookingTimeMeasure.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
ngui/ui/src/components/UpcomingBooking/BookingTimeMeasure/index.ts
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
ngui/ui/src/components/UpcomingBooking/Duration/Duration.tsx
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,35 @@ | ||
import KeyValueLabel from "components/KeyValueLabel/KeyValueLabel"; | ||
import { useFormatIntervalDuration } from "hooks/useFormatIntervalDuration"; | ||
import { INTERVAL_DURATION_VALUE_TYPES } from "utils/datetime"; | ||
|
||
type DurationProps = { | ||
duration: { | ||
weeks: number; | ||
days: number; | ||
hours: number; | ||
minutes: number; | ||
seconds: number; | ||
milliseconds: number; | ||
}; | ||
}; | ||
|
||
const Duration = ({ duration }: DurationProps) => { | ||
const formatInterval = useFormatIntervalDuration(); | ||
|
||
return ( | ||
<KeyValueLabel | ||
keyMessageId="duration" | ||
value={formatInterval({ | ||
formatTo: [ | ||
INTERVAL_DURATION_VALUE_TYPES.WEEKS, | ||
INTERVAL_DURATION_VALUE_TYPES.DAYS, | ||
INTERVAL_DURATION_VALUE_TYPES.HOURS, | ||
INTERVAL_DURATION_VALUE_TYPES.MINUTES | ||
], | ||
duration | ||
})} | ||
/> | ||
); | ||
}; | ||
|
||
export default Duration; |
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,3 @@ | ||
import Duration from "./Duration"; | ||
|
||
export default Duration; |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import BookingTimeMeasure from "./BookingTimeMeasure"; | ||
import UpcomingBooking, { getBookingTimeMeasuresDefinition } from "./UpcomingBooking"; | ||
|
||
export { BookingTimeMeasure, getBookingTimeMeasuresDefinition }; | ||
export { getBookingTimeMeasuresDefinition }; | ||
export default UpcomingBooking; |
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