From c5cb7fd1e3ed5d0ee2a5a948cfafb9a4217910ae Mon Sep 17 00:00:00 2001 From: kuekhaoyang Date: Sat, 29 Nov 2025 13:28:59 +0800 Subject: [PATCH] feat: Update secret page empty state text and prevent search history dropdown from rendering when empty. --- app/secret/page.tsx | 6 +-- components/search/SearchHistoryDropdown.tsx | 42 +++++++++------------ 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/app/secret/page.tsx b/app/secret/page.tsx index 9d8f97f..903cf7a 100644 --- a/app/secret/page.tsx +++ b/app/secret/page.tsx @@ -58,12 +58,12 @@ function SecretHomePage() { )} - {/* Empty State - Hidden mode information */} + {/* Empty State - Adult content zone */} {!loading && !hasSearched && (
-

隐藏模式已激活

+

18+ 专区

- 搜索后将显示结果,搜索记录不会保存到首页历史 + 此区域的搜索记录不会显示在首页历史

)} diff --git a/components/search/SearchHistoryDropdown.tsx b/components/search/SearchHistoryDropdown.tsx index d50bfc6..66ac4f9 100644 --- a/components/search/SearchHistoryDropdown.tsx +++ b/components/search/SearchHistoryDropdown.tsx @@ -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 ? ( - - ) : ( - <> - {/* Header with clear all button */} - + {/* Header with clear all button */} + - {/* Divider */} -
+ {/* Divider */} +
- {/* History items */} -
- {searchHistory.map((item, index) => ( - - ))} -
- - )} + {/* History items */} +
+ {searchHistory.map((item, index) => ( + + ))} +
); }