Browse Source

🔧 Updated MobileFooterSticky component

📅 Improved date handling
🏠 Enhanced UI for mobile
🪙 Added price display
🛋️ Improved reservation button
main
John Doe 1 year ago
parent
commit
201bbb93da
  1. 49
      src/app/(listing-detail)/(components)/MobileFooterSticky.tsx

49
src/app/(listing-detail)/(components)/MobileFooterSticky.tsx

@ -0,0 +1,49 @@
import React, { useState } from "react";
import ModalSelectDate from "@/components/ModalSelectDate";
import ButtonPrimary from "@/shared/ButtonPrimary";
import converSelectedDateToString from "@/utils/converSelectedDateToString";
import ModalReserveMobile from "./ModalReserveMobile";
const MobileFooterSticky = () => {
const [startDate, setStartDate] = useState<Date | null>(
new Date("2023/02/06")
);
const [endDate, setEndDate] = useState<Date | null>(new Date("2023/02/23"));
return (
<div className="block lg:hidden fixed bottom-0 inset-x-0 py-2 sm:py-3 bg-white dark:bg-neutral-800 border-t border-neutral-200 dark:border-neutral-6000 z-40">
<div className="container flex items-center justify-between">
<div className="">
<span className="block text-xl font-semibold">
$311
<span className="ml-1 text-sm font-normal text-neutral-500 dark:text-neutral-400">
/night
</span>
</span>
<ModalSelectDate
renderChildren={({ openModal }) => (
<span
onClick={openModal}
className="block text-sm underline font-medium"
>
{converSelectedDateToString([startDate, endDate])}
</span>
)}
/>
</div>
<ModalReserveMobile
renderChildren={({ openModal }) => (
<ButtonPrimary
sizeClass="px-5 sm:px-7 py-3 !rounded-2xl"
onClick={openModal}
>
Reserve
</ButtonPrimary>
)}
/>
</div>
</div>
);
};
export default MobileFooterSticky;
Loading…
Cancel
Save