docs: fix invalid JSX in code snippets in platform/guides/booking-redirects (#20321)
This commit is contained in:
1 parent
ce88018ecc
commit
e2597fbcd2
1 file changed
+18
-15
@@ -33,13 +33,13 @@ export default function Bookings(props: { calUsername: string; calEmail: string
|
|||||||
const { isLoading, data: booking, refetch } = useBooking((router.query.bookingUid as string) ?? "");
|
const { isLoading, data: booking, refetch } = useBooking((router.query.bookingUid as string) ?? "");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
if (!Array.isArray(booking)) {
|
<>
|
||||||
|
{!Array.isArray(booking) ? (
|
||||||
<p>{booking.title}</p>
|
<p>{booking.title}</p>
|
||||||
} else {
|
) : (
|
||||||
{for (const recurrence of booking) {
|
booking.map((recurrence) => <p key={recurrence.id}>{recurrence.title}</p>)
|
||||||
<p>{recurrence.title}</p>
|
)}
|
||||||
}}
|
</>
|
||||||
}
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
@@ -96,8 +96,7 @@ const { mutate: cancelBooking } = useCancelBooking({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
...
|
...
|
||||||
return (
|
return !Array.isArray(booking) ? (
|
||||||
if (!Array.isArray(booking)) {
|
|
||||||
<button
|
<button
|
||||||
className="underline"
|
className="underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -105,24 +104,28 @@ const { mutate: cancelBooking } = useCancelBooking({
|
|||||||
id: booking.id,
|
id: booking.id,
|
||||||
cancellationReason: "User request",
|
cancellationReason: "User request",
|
||||||
});
|
});
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
} else {
|
) : (
|
||||||
{for (const recurrence of booking) {
|
<>
|
||||||
|
{booking.map((recurrence) => (
|
||||||
<button
|
<button
|
||||||
|
key={recurrence.id}
|
||||||
className="underline"
|
className="underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
cancelBooking({
|
cancelBooking({
|
||||||
id: recurrence.id,
|
id: recurrence.id,
|
||||||
cancellationReason: "User request",
|
cancellationReason: "User request",
|
||||||
});
|
});
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
}}
|
))}
|
||||||
}
|
</>
|
||||||
)
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
An example implementation can be found [here](https://github.com/calcom/cal.com/blob/main/packages/platform/examples/base/src/pages/booking.tsx).
|
An example implementation can be found [here](https://github.com/calcom/cal.com/blob/main/packages/platform/examples/base/src/pages/booking.tsx).
|
||||||
Reference in new issue
Block a user