feat: Update secret page empty state text and prevent search history dropdown from rendering when empty.

This commit is contained in:
kuekhaoyang
2025-11-29 13:28:59 +08:00
parent 3a5c03dee0
commit c5cb7fd1e3
2 changed files with 21 additions and 27 deletions
+3 -3
View File
@@ -58,12 +58,12 @@ function SecretHomePage() {
<NoResults onReset={handleReset} />
)}
{/* Empty State - Hidden mode information */}
{/* Empty State - Adult content zone */}
{!loading && !hasSearched && (
<div className="flex flex-col items-center justify-center py-20 text-center">
<p className="text-lg text-[var(--text-color)] mb-2"></p>
<p className="text-lg text-[var(--text-color)] mb-2">18+ </p>
<p className="text-sm text-[var(--text-color-secondary)]">
</p>
</div>
)}
+18 -24
View File
@@ -50,7 +50,7 @@ export function SearchHistoryDropdown({
}
}, [highlightedIndex]);
if (!isOpen) {
if (!isOpen || searchHistory.length === 0) {
return null;
}
@@ -65,31 +65,25 @@ export function SearchHistoryDropdown({
e.preventDefault();
}}
>
{searchHistory.length === 0 ? (
<SearchHistoryEmptyState />
) : (
<>
{/* Header with clear all button */}
<SearchHistoryHeader onClearAll={onClearAll} />
{/* Header with clear all button */}
<SearchHistoryHeader onClearAll={onClearAll} />
{/* Divider */}
<div className="search-history-divider" />
{/* Divider */}
<div className="search-history-divider" />
{/* History items */}
<div className="search-history-list">
{searchHistory.map((item, index) => (
<SearchHistoryListItem
key={`${item.query}-${item.timestamp}`}
item={item}
index={index}
isHighlighted={index === highlightedIndex}
onSelectItem={onSelectItem}
onRemoveItem={onRemoveItem}
/>
))}
</div>
</>
)}
{/* History items */}
<div className="search-history-list">
{searchHistory.map((item, index) => (
<SearchHistoryListItem
key={`${item.query}-${item.timestamp}`}
item={item}
index={index}
isHighlighted={index === highlightedIndex}
onSelectItem={onSelectItem}
onRemoveItem={onRemoveItem}
/>
))}
</div>
</div>
);
}