Fix mobile reschedule actions (#2534)
This commit is contained in:
parent
5f57694148
commit
7fd57b88dc
4 changed files with 11 additions and 4 deletions
|
@ -87,11 +87,13 @@ function BookingListItem(booking: BookingItem) {
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
id: "edit",
|
id: "edit",
|
||||||
|
icon: ClockIcon,
|
||||||
label: t("edit_booking"),
|
label: t("edit_booking"),
|
||||||
href: `/reschedule/${booking.uid}`,
|
href: `/reschedule/${booking.uid}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "reschedule_request",
|
id: "reschedule_request",
|
||||||
|
icon: ClockIcon,
|
||||||
label: t("send_reschedule_request"),
|
label: t("send_reschedule_request"),
|
||||||
onClick: () => setIsOpenRescheduleDialog(true),
|
onClick: () => setIsOpenRescheduleDialog(true),
|
||||||
},
|
},
|
||||||
|
|
|
@ -52,6 +52,12 @@ const DropdownActions = ({ actions, actionTrigger }: { actions: ActionType[]; ac
|
||||||
};
|
};
|
||||||
|
|
||||||
const TableActions: FC<Props> = ({ actions }) => {
|
const TableActions: FC<Props> = ({ actions }) => {
|
||||||
|
const mobileActions = actions.flatMap((action) => {
|
||||||
|
if (action.actions) {
|
||||||
|
return action.actions;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="hidden space-x-2 rtl:space-x-reverse lg:block">
|
<div className="hidden space-x-2 rtl:space-x-reverse lg:block">
|
||||||
|
@ -72,12 +78,11 @@ const TableActions: FC<Props> = ({ actions }) => {
|
||||||
if (!action.actions) {
|
if (!action.actions) {
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <DropdownActions key={action.id} actions={action.actions} actionTrigger={button} />;
|
return <DropdownActions key={action.id} actions={action.actions} actionTrigger={button} />;
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className="inline-block text-left lg:hidden">
|
<div className="inline-block text-left lg:hidden">
|
||||||
<DropdownActions actions={actions} />
|
<DropdownActions actions={mobileActions} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -760,7 +760,7 @@
|
||||||
"reschedule_request_sent": "Reschedule request sent",
|
"reschedule_request_sent": "Reschedule request sent",
|
||||||
"reschedule_modal_description": "This will cancel the scheduled meeting, notify the scheduler and ask them to pick a new time.",
|
"reschedule_modal_description": "This will cancel the scheduled meeting, notify the scheduler and ask them to pick a new time.",
|
||||||
"reason_for_reschedule_request": "Reason for reschedule request",
|
"reason_for_reschedule_request": "Reason for reschedule request",
|
||||||
"send_reschedule_request": "Send reschedule request",
|
"send_reschedule_request": "Request reschedule ",
|
||||||
"edit_booking": "Edit booking",
|
"edit_booking": "Edit booking",
|
||||||
"reschedule_booking": "Reschedule booking",
|
"reschedule_booking": "Reschedule booking",
|
||||||
"former_time": "Former time"
|
"former_time": "Former time"
|
||||||
|
|
|
@ -29,7 +29,7 @@ export const DropdownMenuContent = forwardRef<HTMLDivElement, DropdownMenuConten
|
||||||
<DropdownMenuPrimitive.Content
|
<DropdownMenuPrimitive.Content
|
||||||
portalled={props.portalled}
|
portalled={props.portalled}
|
||||||
{...props}
|
{...props}
|
||||||
className={`z-10 mt-1 -ml-0 w-48 origin-top-right rounded-sm bg-white text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`}
|
className={`w-50 z-10 mt-1 -ml-0 origin-top-right rounded-sm bg-white text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`}
|
||||||
ref={forwardedRef}>
|
ref={forwardedRef}>
|
||||||
{children}
|
{children}
|
||||||
</DropdownMenuPrimitive.Content>
|
</DropdownMenuPrimitive.Content>
|
||||||
|
|
Loading…
Reference in a new issue