StatusListContainer --> Timeline

This commit is contained in:
Alex Gleason 2022-06-03 12:31:23 -05:00
parent edf366858a
commit 2aa4b41528
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
10 changed files with 11 additions and 11 deletions

View file

@ -9,7 +9,7 @@ import ColumnHeader from 'soapbox/components/column_header';
import { Column } from 'soapbox/components/ui'; import { Column } from 'soapbox/components/ui';
import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
import StatusListContainer from '../ui/containers/status_list_container'; import Timeline from '../ui/components/timeline';
const messages = defineMessages({ const messages = defineMessages({
title: { id: 'column.direct', defaultMessage: 'Direct messages' }, title: { id: 'column.direct', defaultMessage: 'Direct messages' },
@ -52,7 +52,7 @@ const DirectTimeline = () => {
onSelected={handleSuggestion} onSelected={handleSuggestion}
/> />
<StatusListContainer <Timeline
scrollKey='direct_timeline' scrollKey='direct_timeline'
timelineId='direct' timelineId='direct'
onLoadMore={handleLoadMore} onLoadMore={handleLoadMore}

View file

@ -12,7 +12,7 @@ import { Button, Spinner } from 'soapbox/components/ui';
import Column from 'soapbox/features/ui/components/column'; import Column from 'soapbox/features/ui/components/column';
import { useAppSelector } from 'soapbox/hooks'; import { useAppSelector } from 'soapbox/hooks';
import StatusListContainer from '../ui/containers/status_list_container'; import Timeline from '../ui/components/timeline';
// const messages = defineMessages({ // const messages = defineMessages({
// deleteHeading: { id: 'confirmations.delete_list.heading', defaultMessage: 'Delete list' }, // deleteHeading: { id: 'confirmations.delete_list.heading', defaultMessage: 'Delete list' },
@ -110,7 +110,7 @@ const ListTimeline: React.FC = () => {
</div> </div>
</HomeColumnHeader> */} </HomeColumnHeader> */}
<StatusListContainer <Timeline
scrollKey='list_timeline' scrollKey='list_timeline'
timelineId={`list:${id}`} timelineId={`list:${id}`}
onLoadMore={handleLoadMore} onLoadMore={handleLoadMore}

View file

@ -9,7 +9,7 @@ import { HStack, Text } from 'soapbox/components/ui';
import Column from 'soapbox/features/ui/components/column'; import Column from 'soapbox/features/ui/components/column';
import { useAppDispatch, useSettings } from 'soapbox/hooks'; import { useAppDispatch, useSettings } from 'soapbox/hooks';
import StatusListContainer from '../ui/containers/status_list_container'; import Timeline from '../ui/components/timeline';
import PinnedHostsPicker from './components/pinned_hosts_picker'; import PinnedHostsPicker from './components/pinned_hosts_picker';
@ -77,7 +77,7 @@ const RemoteTimeline: React.FC<IRemoteTimeline> = ({ params }) => {
/> />
</Text> </Text>
</HStack>} </HStack>}
<StatusListContainer <Timeline
scrollKey={`${timelineId}_${instance}_timeline`} scrollKey={`${timelineId}_${instance}_timeline`}
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}:${instance}`} timelineId={`${timelineId}${onlyMedia ? ':media' : ''}:${instance}`}
onLoadMore={handleLoadMore} onLoadMore={handleLoadMore}

View file

@ -7,7 +7,7 @@ import { expandTimelineSuccess } from 'soapbox/actions/timelines';
import SubNavigation from 'soapbox/components/sub_navigation'; import SubNavigation from 'soapbox/components/sub_navigation';
import { Column } from '../../components/ui'; import { Column } from '../../components/ui';
import StatusListContainer from '../ui/containers/status_list_container'; import Timeline from '../ui/components/timeline';
const messages = defineMessages({ const messages = defineMessages({
title: { id: 'column.test', defaultMessage: 'Test timeline' }, title: { id: 'column.test', defaultMessage: 'Test timeline' },
@ -40,7 +40,7 @@ const TestTimeline: React.FC = () => {
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column label={intl.formatMessage(messages.title)} transparent>
<SubNavigation message={intl.formatMessage(messages.title)} /> <SubNavigation message={intl.formatMessage(messages.title)} />
<StatusListContainer <Timeline
scrollKey={`${timelineId}_timeline`} scrollKey={`${timelineId}_timeline`}
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`} timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
emptyMessage={<FormattedMessage id='empty_column.test' defaultMessage='The test timeline is empty.' />} emptyMessage={<FormattedMessage id='empty_column.test' defaultMessage='The test timeline is empty.' />}

View file

@ -14,11 +14,11 @@ const messages = defineMessages({
queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' }, queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' },
}); });
interface IStatusListContainer extends Omit<IStatusList, 'statusIds' | 'isLoading' | 'hasMore'> { interface ITimeline extends Omit<IStatusList, 'statusIds' | 'isLoading' | 'hasMore'> {
timelineId: string, timelineId: string,
} }
const StatusListContainer: React.FC<IStatusListContainer> = ({ const Timeline: React.FC<ITimeline> = ({
timelineId, timelineId,
onLoadMore, onLoadMore,
...rest ...rest
@ -68,4 +68,4 @@ const StatusListContainer: React.FC<IStatusListContainer> = ({
); );
}; };
export default StatusListContainer; export default Timeline;