Hide rent-type fields on buy/sell tabs and disable auto-search on tab click
Some checks failed
Build frontend / build (push) Failing after 56s
Some checks failed
Build frontend / build (push) Failing after 56s
- Property type and rent period fields now only display when 'Rent' tab is active - Adjusted grid column spans to fill layout when fields are hidden - Tab switching no longer triggers an automatic search; search runs only on button click
This commit is contained in:
@ -67,9 +67,7 @@ export default function HeroSearch({ onSearch, isAuthenticated }) {
|
|||||||
setActiveTab(tab);
|
setActiveTab(tab);
|
||||||
if ((tab === 'rent' || tab === 'sell') && !isAuthenticated) {
|
if ((tab === 'rent' || tab === 'sell') && !isAuthenticated) {
|
||||||
setShowLoginDialog(true);
|
setShowLoginDialog(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
handleSearch();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
@ -139,6 +137,7 @@ export default function HeroSearch({ onSearch, isAuthenticated }) {
|
|||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
{activeTab === 'rent' && (
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-white mb-2">
|
<label className="block text-sm font-medium text-white mb-2">
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
@ -163,6 +162,7 @@ export default function HeroSearch({ onSearch, isAuthenticated }) {
|
|||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-white mb-2">
|
<label className="block text-sm font-medium text-white mb-2">
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
@ -234,6 +234,7 @@ export default function HeroSearch({ onSearch, isAuthenticated }) {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{activeTab === 'rent' && (
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-white mb-2">نوع الإيجار</label>
|
<label className="block text-sm font-medium text-white mb-2">نوع الإيجار</label>
|
||||||
<select
|
<select
|
||||||
@ -255,8 +256,9 @@ export default function HeroSearch({ onSearch, isAuthenticated }) {
|
|||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="md:col-span-2 flex flex-col justify-between p-4 rounded-2xl border border-dashed border-white/30 bg-white/5">
|
<div className={`${activeTab === 'rent' ? 'md:col-span-2' : 'md:col-span-3'} flex flex-col justify-between p-4 rounded-2xl border border-dashed border-white/30 bg-white/5`}>
|
||||||
<label className="mt-4 flex items-center gap-3 text-white text-sm">
|
<label className="mt-4 flex items-center gap-3 text-white text-sm">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user