From 1f22845b978c5c05d4ec2c6bba339e7ea6b94c80 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 Sep 2024 22:12:15 -0500 Subject: [PATCH] Improve spacing of Notifications and Search on mobile --- src/components/ui/column/column.tsx | 4 ++-- .../compose/components/search-results.tsx | 4 +++- src/features/home-timeline/index.tsx | 1 - src/features/notifications/index.tsx | 13 +++++++++++-- src/features/search/index.tsx | 15 +++++++++++++-- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/components/ui/column/column.tsx b/src/components/ui/column/column.tsx index 73e376f4d..3d7326f2a 100644 --- a/src/components/ui/column/column.tsx +++ b/src/components/ui/column/column.tsx @@ -104,8 +104,8 @@ const Column: React.FC = React.forwardRef((props, ref: React.ForwardedR 'rounded-t-3xl': !isScrolled && !transparent, 'sticky top-12 z-10 bg-white/90 dark:bg-primary-900/90 black:bg-black/90 backdrop-blur lg:top-16': !transparent, 'p-4 sm:p-0 sm:pb-4 black:p-4': transparent, - '-mt-4 -mx-4 p-4': size !== 'lg' && !transparent, - '-mt-4 -mx-4 p-4 sm:-mt-6 sm:-mx-6 sm:p-6': size === 'lg' && !transparent, + '-mt-4 p-4': size !== 'lg' && !transparent, + '-mt-4 p-4 sm:-mt-6 sm:-mx-6 sm:p-6': size === 'lg' && !transparent, })} action={action} /> diff --git a/src/features/compose/components/search-results.tsx b/src/features/compose/components/search-results.tsx index 697af1869..18bfa496c 100644 --- a/src/features/compose/components/search-results.tsx +++ b/src/features/compose/components/search-results.tsx @@ -148,6 +148,7 @@ const SearchResults = () => { id={statusId} onMoveUp={handleMoveUp} onMoveDown={handleMoveDown} + variant='slim' /> )); resultsIds = results.statuses; @@ -159,6 +160,7 @@ const SearchResults = () => { id={statusId} onMoveUp={handleMoveUp} onMoveDown={handleMoveDown} + variant='slim' /> )); resultsIds = trendingStatuses; @@ -229,7 +231,7 @@ const SearchResults = () => { listClassName={clsx({ 'divide-gray-200 dark:divide-gray-800 divide-solid divide-y': selectedFilter === 'statuses', })} - itemClassName={clsx({ + itemClassName={clsx('px-4', { 'pb-4': selectedFilter === 'accounts', 'pb-3': selectedFilter === 'hashtags', })} diff --git a/src/features/home-timeline/index.tsx b/src/features/home-timeline/index.tsx index 3ac3c23d9..24f58f4f2 100644 --- a/src/features/home-timeline/index.tsx +++ b/src/features/home-timeline/index.tsx @@ -70,7 +70,6 @@ const HomeTimeline: React.FC = () => { onLoadMore={handleLoadMore} timelineId='home' divideType={(theme === 'black' || isMobile) ? 'border' : 'space'} - showAds emptyMessage={ diff --git a/src/features/notifications/index.tsx b/src/features/notifications/index.tsx index 870ce8ad1..abfa780f3 100644 --- a/src/features/notifications/index.tsx +++ b/src/features/notifications/index.tsx @@ -16,7 +16,8 @@ import ScrollTopButton from 'soapbox/components/scroll-top-button'; import ScrollableList from 'soapbox/components/scrollable-list'; import { Column, Portal } from 'soapbox/components/ui'; import PlaceholderNotification from 'soapbox/features/placeholder/components/placeholder-notification'; -import { useAppDispatch, useAppSelector, useSettings } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useSettings, useTheme } from 'soapbox/hooks'; +import { useIsMobile } from 'soapbox/hooks/useIsMobile'; import FilterBar from './components/filter-bar'; import Notification from './components/notification'; @@ -58,6 +59,9 @@ const Notifications = () => { const hasMore = useAppSelector(state => state.notifications.hasMore); const totalQueuedNotificationsCount = useAppSelector(state => state.notifications.totalQueuedNotificationsCount || 0); + const theme = useTheme(); + const isMobile = useIsMobile(); + const node = useRef(null); const column = useRef(null); const scrollableContentRef = useRef | null>(null); @@ -174,7 +178,12 @@ const Notifications = () => { ); return ( - + {filterBarContainer} diff --git a/src/features/search/index.tsx b/src/features/search/index.tsx index beee52773..97e5a37ca 100644 --- a/src/features/search/index.tsx +++ b/src/features/search/index.tsx @@ -1,9 +1,12 @@ +import clsx from 'clsx'; import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Column } from 'soapbox/components/ui'; import Search from 'soapbox/features/compose/components/search'; import SearchResults from 'soapbox/features/compose/components/search-results'; +import { useTheme } from 'soapbox/hooks'; +import { useIsMobile } from 'soapbox/hooks/useIsMobile'; const messages = defineMessages({ heading: { id: 'column.search', defaultMessage: 'Discover' }, @@ -12,10 +15,18 @@ const messages = defineMessages({ const SearchPage = () => { const intl = useIntl(); + const theme = useTheme(); + const isMobile = useIsMobile(); + return ( - +
- +
+ +