EmbeddedStatus: add SiteLogo
This commit is contained in:
parent
9ca87c1eec
commit
c013dcf01b
|
@ -49,6 +49,7 @@ export interface IStatus {
|
||||||
hoverable?: boolean,
|
hoverable?: boolean,
|
||||||
variant?: 'default' | 'rounded',
|
variant?: 'default' | 'rounded',
|
||||||
withDismiss?: boolean,
|
withDismiss?: boolean,
|
||||||
|
accountAction?: React.ReactElement,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Status: React.FC<IStatus> = (props) => {
|
const Status: React.FC<IStatus> = (props) => {
|
||||||
|
@ -68,6 +69,7 @@ const Status: React.FC<IStatus> = (props) => {
|
||||||
variant = 'rounded',
|
variant = 'rounded',
|
||||||
withDismiss,
|
withDismiss,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -295,6 +297,8 @@ const Status: React.FC<IStatus> = (props) => {
|
||||||
|
|
||||||
const statusUrl = `/@${actualStatus.getIn(['account', 'acct'])}/posts/${actualStatus.id}`;
|
const statusUrl = `/@${actualStatus.getIn(['account', 'acct'])}/posts/${actualStatus.id}`;
|
||||||
|
|
||||||
|
const accountAction = props.accountAction || reblogElement;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={handlers} data-testid='status'>
|
<HotKeys handlers={handlers} data-testid='status'>
|
||||||
<div
|
<div
|
||||||
|
@ -335,8 +339,8 @@ const Status: React.FC<IStatus> = (props) => {
|
||||||
id={String(actualStatus.getIn(['account', 'id']))}
|
id={String(actualStatus.getIn(['account', 'id']))}
|
||||||
timestamp={actualStatus.created_at}
|
timestamp={actualStatus.created_at}
|
||||||
timestampUrl={statusUrl}
|
timestampUrl={statusUrl}
|
||||||
action={reblogElement}
|
action={accountAction}
|
||||||
hideActions={!reblogElement}
|
hideActions={!accountAction}
|
||||||
showEdit={!!actualStatus.edited_at}
|
showEdit={!!actualStatus.edited_at}
|
||||||
showProfileHoverCard={hoverable}
|
showProfileHoverCard={hoverable}
|
||||||
withLinkToProfile={hoverable}
|
withLinkToProfile={hoverable}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { fetchStatus } from 'soapbox/actions/statuses';
|
import { fetchStatus } from 'soapbox/actions/statuses';
|
||||||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||||
|
import SiteLogo from 'soapbox/components/site-logo';
|
||||||
import Status from 'soapbox/components/status';
|
import Status from 'soapbox/components/status';
|
||||||
import { Spinner } from 'soapbox/components/ui';
|
import { Spinner } from 'soapbox/components/ui';
|
||||||
import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
|
import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
|
||||||
|
@ -43,11 +44,17 @@ const EmbeddedStatus: React.FC<IEmbeddedStatus> = ({ params }) => {
|
||||||
}, '*');
|
}, '*');
|
||||||
}, [status, loading]);
|
}, [status, loading]);
|
||||||
|
|
||||||
|
const logo = (
|
||||||
|
<div className='flex align-middle justify-center ml-4'>
|
||||||
|
<SiteLogo className='h-10' />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
const renderInner = () => {
|
const renderInner = () => {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <Spinner />;
|
return <Spinner />;
|
||||||
} else if (status) {
|
} else if (status) {
|
||||||
return <Status status={status} variant='default' />;
|
return <Status status={status} accountAction={logo} variant='default' />;
|
||||||
} else {
|
} else {
|
||||||
return <MissingIndicator nested />;
|
return <MissingIndicator nested />;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue