unable villas style

This commit is contained in:
2024-02-26 18:06:53 +05:00
parent 0d96c4b540
commit 50c24be8b1
2 changed files with 21 additions and 4 deletions
+12 -3
View File
@@ -6,9 +6,10 @@ import ViewOnMapButton from "../../mobile/Main/ViewOnMapButton";
type HouseItemProps = {
villa: Villa;
isDisable?: boolean;
};
const HouseItem = ({ villa }: HouseItemProps) => {
const HouseItem = ({ villa, isDisable = false }: HouseItemProps) => {
const { setSelectedOnMapVilla, setModal, selectedOnMapVilla } = useStore();
const navigate = useNavigate();
@@ -22,7 +23,11 @@ const HouseItem = ({ villa }: HouseItemProps) => {
};
return (
<div className="flex flex-col border border-[#DDD7D6] rounded-2xl">
<div
className={`flex flex-col border border-[#DDD7D6] rounded-2xl ${
isDisable ? "bg-slate-200" : ""
}`}
>
<div className="flex p-1 h-[107px] w-full text-[12px] font-medium gap-4">
<div className="w-full overflow-hidden rounded-[4px] rounded-ss-xl">
{villa?.perspectiveWorkings[0]?.image && (
@@ -46,7 +51,11 @@ const HouseItem = ({ villa }: HouseItemProps) => {
<div>{villa.villaTheme}</div>
</div>
</div>
<div className="border-0 border-t-[1px] text-sm flex">
<div
className={`border-0 border-t-[1px] text-sm flex ${
isDisable ? "pointer-events-none" : ""
}`}
>
<ViewOnMapButton
onClick={handleOnViewOnMapClick}
isVillaSelected={selectedOnMapVilla?.type === villa.type}
+9 -1
View File
@@ -1,12 +1,20 @@
import HouseItem from "./HouseItem";
import { VILLAS } from "../../../consts/villas";
// a1t/m, b2t/m
const enableVillas = ["a1t", "a1m", "b2t", "b2m"];
const HouseList = () => {
return (
<div className="max-h-screen overflow-y-scroll">
<div className="flex flex-col gap-2 p-4">
{VILLAS.map((villa) => {
return <HouseItem villa={villa} key={villa.type} />;
return (
<HouseItem
villa={villa}
key={villa.type}
isDisable={!enableVillas.includes(villa.type)}
/>
);
})}
</div>
</div>