Thread: fix position of ThreadLoginCta

This commit is contained in:
Alex Gleason 2023-09-20 14:32:20 -05:00
parent df2c2288fb
commit bdb5f4a2cf
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 18 additions and 16 deletions

View File

@ -18,13 +18,12 @@ import { Stack } from 'soapbox/components/ui';
import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status'; import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status';
import { HotKeys } from 'soapbox/features/ui/components/hotkeys'; import { HotKeys } from 'soapbox/features/ui/components/hotkeys';
import PendingStatus from 'soapbox/features/ui/components/pending-status'; import PendingStatus from 'soapbox/features/ui/components/pending-status';
import { useAppDispatch, useAppSelector, useOwnAccount, useSettings } from 'soapbox/hooks'; import { useAppDispatch, useAppSelector, useSettings } from 'soapbox/hooks';
import { RootState } from 'soapbox/store'; import { RootState } from 'soapbox/store';
import { type Account, type Status } from 'soapbox/types/entities'; import { type Account, type Status } from 'soapbox/types/entities';
import { defaultMediaVisibility, textForScreenReader } from 'soapbox/utils/status'; import { defaultMediaVisibility, textForScreenReader } from 'soapbox/utils/status';
import DetailedStatus from './detailed-status'; import DetailedStatus from './detailed-status';
import ThreadLoginCta from './thread-login-cta';
import ThreadStatus from './thread-status'; import ThreadStatus from './thread-status';
type DisplayMedia = 'default' | 'hide_all' | 'show_all'; type DisplayMedia = 'default' | 'hide_all' | 'show_all';
@ -97,7 +96,6 @@ const Thread = (props: IThread) => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const history = useHistory(); const history = useHistory();
const intl = useIntl(); const intl = useIntl();
const { account: me } = useOwnAccount();
const settings = useSettings(); const settings = useSettings();
const displayMedia = settings.get('displayMedia') as DisplayMedia; const displayMedia = settings.get('displayMedia') as DisplayMedia;
@ -459,8 +457,6 @@ const Thread = (props: IThread) => {
{children} {children}
</ScrollableList> </ScrollableList>
</div> </div>
{!me && <ThreadLoginCta />}
</Stack> </Stack>
); );
}; };

View File

@ -9,12 +9,13 @@ import {
} from 'soapbox/actions/statuses'; } from 'soapbox/actions/statuses';
import MissingIndicator from 'soapbox/components/missing-indicator'; import MissingIndicator from 'soapbox/components/missing-indicator';
import PullToRefresh from 'soapbox/components/pull-to-refresh'; import PullToRefresh from 'soapbox/components/pull-to-refresh';
import { Column } from 'soapbox/components/ui'; import { Column, Stack } from 'soapbox/components/ui';
import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status'; import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status';
import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; import { useAppDispatch, useAppSelector, useLoggedIn } from 'soapbox/hooks';
import { makeGetStatus } from 'soapbox/selectors'; import { makeGetStatus } from 'soapbox/selectors';
import Thread from './components/thread'; import Thread from './components/thread';
import ThreadLoginCta from './components/thread-login-cta';
const messages = defineMessages({ const messages = defineMessages({
title: { id: 'status.title', defaultMessage: 'Post Details' }, title: { id: 'status.title', defaultMessage: 'Post Details' },
@ -47,6 +48,7 @@ interface IStatusDetails {
const StatusDetails: React.FC<IStatusDetails> = (props) => { const StatusDetails: React.FC<IStatusDetails> = (props) => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const intl = useIntl(); const intl = useIntl();
const { isLoggedIn } = useLoggedIn();
const getStatus = useCallback(makeGetStatus(), []); const getStatus = useCallback(makeGetStatus(), []);
const status = useAppSelector((state) => getStatus(state, { id: props.params.statusId })); const status = useAppSelector((state) => getStatus(state, { id: props.params.statusId }));
@ -113,15 +115,19 @@ const StatusDetails: React.FC<IStatusDetails> = (props) => {
}; };
return ( return (
<Column label={intl.formatMessage(titleMessage())}> <Stack space={4}>
<PullToRefresh onRefresh={handleRefresh}> <Column label={intl.formatMessage(titleMessage())}>
<Thread <PullToRefresh onRefresh={handleRefresh}>
status={status} <Thread
next={next} status={status}
handleLoadMore={handleLoadMore} next={next}
/> handleLoadMore={handleLoadMore}
</PullToRefresh> />
</Column> </PullToRefresh>
</Column>
{!isLoggedIn && <ThreadLoginCta />}
</Stack>
); );
}; };