feat: SW-276 Updated translations

This commit is contained in:
Hrishikesh Vaipurkar
2024-09-18 16:47:19 +02:00
parent a7167dde6a
commit 510880d697
12 changed files with 41 additions and 28 deletions

View File

@@ -4,17 +4,9 @@ import Select from "@/components/TempDesignSystem/Select"
import {
Child,
ChildBed,
ChildInfoSelectorProps,
} from "@/types/components/bookingWidget/guestsRoomsPicker"
type ChildSelectorProps = {
child: Child
index: number
availableBedTypes?: ChildBed[]
updateChild: (child: Child, index: number) => void
childAgeError: boolean
}
export default function ChildInfoSelector({
child = { age: -1, bed: -1 },
index = 0,
@@ -24,10 +16,11 @@ export default function ChildInfoSelector({
{ label: "In extra bed", value: 2 },
],
updateChild = (child: Child, index: number) => {},
childAgeError,
}: ChildSelectorProps) {
isValid,
}: ChildInfoSelectorProps) {
const intl = useIntl()
const ageLabel = intl.formatMessage({ id: "Age" })
const ageReqdErrMsg = intl.formatMessage({ id: "Child age is required" })
const bedLabel = intl.formatMessage({ id: "Bed" })
const ageList = [
@@ -70,9 +63,7 @@ export default function ChildInfoSelector({
name="age"
placeholder={ageLabel}
/>
{childAgeError && child.age < 0 ? (
<span>Child Age is required</span>
) : null}
{!isValid && child.age < 0 ? <span>{ageReqdErrMsg}</span> : null}
</div>
<div>
{child.age !== -1 ? (

View File

@@ -17,7 +17,7 @@ export default function ChildSelector({
roomChildren = [],
adultCount = 1,
updateChildren = (children: Child[]) => {},
childAgeError,
isValid,
}: ChildSelectorProps) {
const intl = useIntl()
const childrenLabel = intl.formatMessage({ id: "Children" })
@@ -107,7 +107,7 @@ export default function ChildSelector({
child={child}
availableBedTypes={childBedTypes[index]}
updateChild={updateChildInfo}
childAgeError={childAgeError}
isValid={isValid}
/>
</div>
))}

View File

@@ -17,7 +17,7 @@ export default function GuestsRoomPicker({
handleOnSelect = (selected: GuestsRoom, index: number) => {},
room = { adults: 1, children: [] },
index = 1,
childAgeError,
isValid,
}: GuestsRoomPickerProps) {
const intl = useIntl()
const roomLabel = intl.formatMessage({ id: "Room" })
@@ -42,7 +42,7 @@ export default function GuestsRoomPicker({
roomChildren={room.children}
adultCount={room.adults}
updateChildren={updateChildren}
childAgeError={childAgeError}
isValid={isValid}
/>
</section>
)