diff --git a/src/components/scrollable-list.tsx b/src/components/scrollable-list.tsx index f31fed579..ffce6e844 100644 --- a/src/components/scrollable-list.tsx +++ b/src/components/scrollable-list.tsx @@ -226,7 +226,6 @@ const ScrollableList = React.forwardRef(({ ref={ref} id={id} useWindowScroll={useWindowScroll} - className={className} data={data} startReached={onScrollToTop} endReached={handleEndReached} diff --git a/src/components/status-list.tsx b/src/components/status-list.tsx index ba366a38e..ed1f391b1 100644 --- a/src/components/status-list.tsx +++ b/src/components/status-list.tsx @@ -56,6 +56,7 @@ const StatusList: React.FC = ({ isPartial, showAds = false, showGroup = true, + className, ...other }) => { const soapboxConfig = useSoapboxConfig(); @@ -232,8 +233,8 @@ const StatusList: React.FC = ({ placeholderCount={20} ref={node} className={clsx('divide-y divide-solid divide-gray-200 dark:divide-gray-800', { - 'divide-none black:divide-solid': divideType !== 'border', - })} + 'divide-none': divideType !== 'border', + }, className)} itemClassName={clsx({ 'pb-3': divideType !== 'border', })} diff --git a/src/features/bookmarks/index.tsx b/src/features/bookmarks/index.tsx index d949749cf..e63a0ad34 100644 --- a/src/features/bookmarks/index.tsx +++ b/src/features/bookmarks/index.tsx @@ -6,7 +6,7 @@ import { fetchBookmarkedStatuses, expandBookmarkedStatuses } from 'soapbox/actio import PullToRefresh from 'soapbox/components/pull-to-refresh'; import StatusList from 'soapbox/components/status-list'; import { Column } from 'soapbox/components/ui'; -import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch, useTheme } from 'soapbox/hooks'; const messages = defineMessages({ heading: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' }, @@ -19,6 +19,7 @@ const handleLoadMore = debounce((dispatch) => { const Bookmarks: React.FC = () => { const dispatch = useAppDispatch(); const intl = useIntl(); + const theme = useTheme(); const statusIds = useAppSelector((state) => state.status_lists.get('bookmarks')!.items); const isLoading = useAppSelector((state) => state.status_lists.get('bookmarks')!.isLoading); @@ -38,13 +39,14 @@ const Bookmarks: React.FC = () => { handleLoadMore(dispatch)} emptyMessage={emptyMessage} - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> diff --git a/src/features/community-timeline/index.tsx b/src/features/community-timeline/index.tsx index 724d9997f..9e7fca257 100644 --- a/src/features/community-timeline/index.tsx +++ b/src/features/community-timeline/index.tsx @@ -5,7 +5,7 @@ import { expandCommunityTimeline } from 'soapbox/actions/timelines'; import { useCommunityStream } from 'soapbox/api/hooks'; import PullToRefresh from 'soapbox/components/pull-to-refresh'; import { Column } from 'soapbox/components/ui'; -import { useAppSelector, useAppDispatch, useSettings } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch, useSettings, useTheme } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; @@ -16,6 +16,7 @@ const messages = defineMessages({ const CommunityTimeline = () => { const intl = useIntl(); const dispatch = useAppDispatch(); + const theme = useTheme(); const settings = useSettings(); const onlyMedia = settings.community.other.onlyMedia; @@ -41,12 +42,13 @@ const CommunityTimeline = () => { } - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> diff --git a/src/features/hashtag-timeline/index.tsx b/src/features/hashtag-timeline/index.tsx index 27d8212ea..b00a27c14 100644 --- a/src/features/hashtag-timeline/index.tsx +++ b/src/features/hashtag-timeline/index.tsx @@ -7,7 +7,7 @@ import { useHashtagStream } from 'soapbox/api/hooks'; import List, { ListItem } from 'soapbox/components/list'; import { Column, Toggle } from 'soapbox/components/ui'; import Timeline from 'soapbox/features/ui/components/timeline'; -import { useAppDispatch, useAppSelector, useFeatures, useLoggedIn } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useFeatures, useLoggedIn, useTheme } from 'soapbox/hooks'; interface IHashtagTimeline { params?: { @@ -23,6 +23,7 @@ export const HashtagTimeline: React.FC = ({ params }) => { const tag = useAppSelector((state) => state.tags.get(id)); const next = useAppSelector(state => state.timelines.get(`hashtag:${id}`)?.next); const { isLoggedIn } = useLoggedIn(); + const theme = useTheme(); const handleLoadMore = (maxId: string) => { dispatch(expandHashtagTimeline(id, { url: next, maxId })); @@ -63,11 +64,12 @@ export const HashtagTimeline: React.FC = ({ params }) => { )} } - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> ); diff --git a/src/features/home-timeline/index.tsx b/src/features/home-timeline/index.tsx index a24dcbe5f..dd6bdd75d 100644 --- a/src/features/home-timeline/index.tsx +++ b/src/features/home-timeline/index.tsx @@ -6,7 +6,7 @@ import { expandHomeTimeline } from 'soapbox/actions/timelines'; import PullToRefresh from 'soapbox/components/pull-to-refresh'; import { Column, Stack, Text } from 'soapbox/components/ui'; import Timeline from 'soapbox/features/ui/components/timeline'; -import { useAppSelector, useAppDispatch, useFeatures, useInstance } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch, useFeatures, useInstance, useTheme } from 'soapbox/hooks'; const messages = defineMessages({ title: { id: 'column.home', defaultMessage: 'Home' }, @@ -17,6 +17,7 @@ const HomeTimeline: React.FC = () => { const dispatch = useAppDispatch(); const features = useFeatures(); const instance = useInstance(); + const theme = useTheme(); const polling = useRef(null); @@ -62,10 +63,11 @@ const HomeTimeline: React.FC = () => { diff --git a/src/features/landing-timeline/index.tsx b/src/features/landing-timeline/index.tsx index 95e000408..aa08a5783 100644 --- a/src/features/landing-timeline/index.tsx +++ b/src/features/landing-timeline/index.tsx @@ -5,7 +5,7 @@ import { expandCommunityTimeline } from 'soapbox/actions/timelines'; import { useCommunityStream } from 'soapbox/api/hooks'; import PullToRefresh from 'soapbox/components/pull-to-refresh'; import { Column } from 'soapbox/components/ui'; -import { useAppSelector, useAppDispatch, useInstance } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch, useInstance, useTheme } from 'soapbox/hooks'; import AboutPage from '../about'; import Timeline from '../ui/components/timeline'; @@ -15,6 +15,7 @@ import { SiteBanner } from './components/site-banner'; const LandingTimeline = () => { const dispatch = useAppDispatch(); const instance = useInstance(); + const theme = useTheme(); const timelineEnabled = !instance.pleroma.metadata.restrict_unauthenticated.timelines.local; const next = useAppSelector(state => state.timelines.get('community')?.next); @@ -50,12 +51,13 @@ const LandingTimeline = () => { {timelineEnabled ? ( } - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> ) : ( diff --git a/src/features/list-timeline/index.tsx b/src/features/list-timeline/index.tsx index e9b56aada..ec1e412dd 100644 --- a/src/features/list-timeline/index.tsx +++ b/src/features/list-timeline/index.tsx @@ -8,13 +8,14 @@ import { expandListTimeline } from 'soapbox/actions/timelines'; import { useListStream } from 'soapbox/api/hooks'; import MissingIndicator from 'soapbox/components/missing-indicator'; import { Column, Button, Spinner } from 'soapbox/components/ui'; -import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useTheme } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; const ListTimeline: React.FC = () => { const dispatch = useAppDispatch(); const { id } = useParams<{ id: string }>(); + const theme = useTheme(); const list = useAppSelector((state) => state.lists.get(id)); const next = useAppSelector(state => state.timelines.get(`list:${id}`)?.next); @@ -61,11 +62,12 @@ const ListTimeline: React.FC = () => { return ( ); diff --git a/src/features/notifications/index.tsx b/src/features/notifications/index.tsx index a8709fd49..174041990 100644 --- a/src/features/notifications/index.tsx +++ b/src/features/notifications/index.tsx @@ -165,7 +165,7 @@ const Notifications = () => { onScrollToTop={handleScrollToTop} onScroll={handleScroll} className={clsx({ - 'divide-y divide-gray-200 dark:divide-primary-800 divide-solid': notifications.size > 0, + 'divide-y divide-gray-200 black:divide-gray-800 dark:divide-primary-800 divide-solid': notifications.size > 0, 'space-y-2': notifications.size === 0, })} > diff --git a/src/features/public-timeline/index.tsx b/src/features/public-timeline/index.tsx index c5a42f2a3..e9caa6472 100644 --- a/src/features/public-timeline/index.tsx +++ b/src/features/public-timeline/index.tsx @@ -7,7 +7,7 @@ import { expandPublicTimeline } from 'soapbox/actions/timelines'; import { usePublicStream } from 'soapbox/api/hooks'; import PullToRefresh from 'soapbox/components/pull-to-refresh'; import { Accordion, Column } from 'soapbox/components/ui'; -import { useAppSelector, useAppDispatch, useInstance, useSettings } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch, useInstance, useSettings, useTheme } from 'soapbox/hooks'; import PinnedHostsPicker from '../remote-timeline/components/pinned-hosts-picker'; import Timeline from '../ui/components/timeline'; @@ -20,6 +20,7 @@ const messages = defineMessages({ const CommunityTimeline = () => { const intl = useIntl(); const dispatch = useAppDispatch(); + const theme = useTheme(); const instance = useInstance(); const settings = useSettings(); @@ -86,12 +87,13 @@ const CommunityTimeline = () => { } } - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> diff --git a/src/features/quotes/index.tsx b/src/features/quotes/index.tsx index 7b0d057fe..60ea8a550 100644 --- a/src/features/quotes/index.tsx +++ b/src/features/quotes/index.tsx @@ -7,7 +7,7 @@ import { useParams } from 'react-router-dom'; import { expandStatusQuotes, fetchStatusQuotes } from 'soapbox/actions/status-quotes'; import StatusList from 'soapbox/components/status-list'; import { Column } from 'soapbox/components/ui'; -import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useTheme } from 'soapbox/hooks'; const messages = defineMessages({ heading: { id: 'column.quotes', defaultMessage: 'Post quotes' }, @@ -20,6 +20,7 @@ const Quotes: React.FC = () => { const dispatch = useAppDispatch(); const intl = useIntl(); const { statusId } = useParams<{ statusId: string }>(); + const theme = useTheme(); const statusIds = useAppSelector((state) => state.status_lists.getIn([`quotes:${statusId}`, 'items'], ImmutableOrderedSet())); const isLoading = useAppSelector((state) => state.status_lists.getIn([`quotes:${statusId}`, 'isLoading'], true)); @@ -38,6 +39,7 @@ const Quotes: React.FC = () => { return ( } scrollKey={`quotes:${statusId}`} hasMore={hasMore} @@ -45,7 +47,7 @@ const Quotes: React.FC = () => { onLoadMore={() => handleLoadMore(statusId, dispatch)} onRefresh={handleRefresh} emptyMessage={emptyMessage} - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> ); diff --git a/src/features/remote-timeline/index.tsx b/src/features/remote-timeline/index.tsx index 4d5a65ffb..a50875531 100644 --- a/src/features/remote-timeline/index.tsx +++ b/src/features/remote-timeline/index.tsx @@ -6,7 +6,7 @@ import { expandRemoteTimeline } from 'soapbox/actions/timelines'; import { useRemoteStream } from 'soapbox/api/hooks'; import IconButton from 'soapbox/components/icon-button'; import { Column, HStack, Text } from 'soapbox/components/ui'; -import { useAppSelector, useAppDispatch, useSettings } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch, useSettings, useTheme } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; @@ -22,6 +22,7 @@ interface IRemoteTimeline { const RemoteTimeline: React.FC = ({ params }) => { const history = useHistory(); const dispatch = useAppDispatch(); + const theme = useTheme(); const instance = params?.instance as string; const settings = useSettings(); @@ -64,6 +65,7 @@ const RemoteTimeline: React.FC = ({ params }) => { )} = ({ params }) => { values={{ instance }} /> } - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> ); diff --git a/src/features/test-timeline/index.tsx b/src/features/test-timeline/index.tsx index 1601dc165..623ef9d33 100644 --- a/src/features/test-timeline/index.tsx +++ b/src/features/test-timeline/index.tsx @@ -3,7 +3,7 @@ import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { importFetchedStatuses } from 'soapbox/actions/importer'; import { expandTimelineSuccess } from 'soapbox/actions/timelines'; -import { useAppDispatch } from 'soapbox/hooks'; +import { useAppDispatch, useTheme } from 'soapbox/hooks'; import { Column } from '../../components/ui'; import Timeline from '../ui/components/timeline'; @@ -31,6 +31,7 @@ const onlyMedia = false; const TestTimeline: React.FC = () => { const intl = useIntl(); const dispatch = useAppDispatch(); + const theme = useTheme(); React.useEffect(() => { dispatch(importFetchedStatuses(MOCK_STATUSES)); @@ -43,7 +44,7 @@ const TestTimeline: React.FC = () => { scrollKey={`${timelineId}_timeline`} timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`} emptyMessage={} - divideType='space' + divideType={theme === 'black' ? 'border' : 'space'} /> ); diff --git a/src/features/ui/components/theme-selector.tsx b/src/features/ui/components/theme-selector.tsx index ec54126af..f11c19213 100644 --- a/src/features/ui/components/theme-selector.tsx +++ b/src/features/ui/components/theme-selector.tsx @@ -6,7 +6,7 @@ import { Icon, Select } from 'soapbox/components/ui'; const messages = defineMessages({ light: { id: 'theme_toggle.light', defaultMessage: 'Light' }, dark: { id: 'theme_toggle.dark', defaultMessage: 'Dark' }, - black: { id: 'theme_toggle.black', defaultMessage: 'Pure Black (beta)' }, + black: { id: 'theme_toggle.black', defaultMessage: 'Black' }, system: { id: 'theme_toggle.system', defaultMessage: 'System' }, }); @@ -28,7 +28,7 @@ const ThemeSelector: React.FC = ({ value, onChange }) => { case 'dark': return require('@tabler/icons/moon.svg'); case 'black': - return require('@tabler/icons/moon-off.svg'); + return require('@tabler/icons/shadow.svg'); default: return null; }