mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(catalog): improve empty search state and footer layout
Show centered Nothing Found for catalog searches with no matches, mirror search results labels at the bottom footer, split nav from the style row, and drop the desktop catalog footer top margin.
This commit is contained in:
@@ -523,7 +523,6 @@ export const MobileBoardButtons = () => {
|
||||
const resolvedAddress = useResolvedCommunityAddress();
|
||||
const communityAddress = resolvedAddress || accountComment?.communityAddress;
|
||||
|
||||
const { filteredCount, searchText } = useCatalogFiltersStore();
|
||||
const enableInfiniteScroll = useFeedViewSettingsStore((state) => state.enableInfiniteScroll);
|
||||
const isMultiboard = isInAllView || isInSubscriptionsView || isInModView;
|
||||
const showTimeFilter = isMultiboard;
|
||||
@@ -574,19 +573,7 @@ export const MobileBoardButtons = () => {
|
||||
isInModView={isInModView}
|
||||
isMobilePlacement={true}
|
||||
/>
|
||||
{searchText ? (
|
||||
<span className={styles.filteredThreadsCount}>
|
||||
{' '}
|
||||
- {t('search_results_for')}: <strong>{searchText}</strong>
|
||||
</span>
|
||||
) : (
|
||||
filteredCount > 0 && (
|
||||
<span className={styles.filteredThreadsCount}>
|
||||
{' '}
|
||||
- {t('filtered_threads')}: <strong>{filteredCount}</strong>
|
||||
</span>
|
||||
)
|
||||
)}
|
||||
<CatalogSearchResultsLabel />
|
||||
{(isInAllView || showTimeFilter || isInCatalogView) && (
|
||||
<>
|
||||
<hr />
|
||||
@@ -683,6 +670,31 @@ export const PostPageStats = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const CatalogSearchResultsLabel = () => {
|
||||
const { t } = useTranslation();
|
||||
const { filteredCount, searchText } = useCatalogFiltersStore();
|
||||
|
||||
if (searchText) {
|
||||
return (
|
||||
<span className={styles.filteredThreadsCount}>
|
||||
{' '}
|
||||
— {t('search_results_for')}: <strong>{searchText}</strong>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (filteredCount > 0) {
|
||||
return (
|
||||
<span className={styles.filteredThreadsCount}>
|
||||
{' '}
|
||||
— {t('filtered_threads')}: <strong>{filteredCount}</strong>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export const DesktopBoardButtons = () => {
|
||||
const { t } = useTranslation();
|
||||
const params = useParams();
|
||||
@@ -698,7 +710,6 @@ export const DesktopBoardButtons = () => {
|
||||
const isInModView = isModView(location.pathname);
|
||||
const isInModQueueView = isModQueueView(location.pathname);
|
||||
|
||||
const { filteredCount, searchText } = useCatalogFiltersStore();
|
||||
const enableInfiniteScroll = useFeedViewSettingsStore((state) => state.enableInfiniteScroll);
|
||||
const isMultiboard = isInAllView || isInSubscriptionsView || isInModView;
|
||||
const showTimeFilter = isMultiboard;
|
||||
@@ -794,20 +805,7 @@ export const DesktopBoardButtons = () => {
|
||||
<ModQueueButton boardIdentifier={boardIdentifier} isMobile={false} />
|
||||
</>
|
||||
)}
|
||||
{isInCatalogView && searchText ? (
|
||||
<span className={styles.filteredThreadsCount}>
|
||||
{' '}
|
||||
- {t('search_results_for')}: <strong>{searchText}</strong>
|
||||
</span>
|
||||
) : (
|
||||
isInCatalogView &&
|
||||
filteredCount > 0 && (
|
||||
<span className={styles.filteredThreadsCount}>
|
||||
{' '}
|
||||
- {t('filtered_threads')}: <strong>{filteredCount}</strong>
|
||||
</span>
|
||||
)
|
||||
)}
|
||||
{isInCatalogView && <CatalogSearchResultsLabel />}
|
||||
<span className={styles.rightSideButtons}>
|
||||
{isInCatalogView && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user