pl-fe: only use logo if provided
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@@ -7,7 +7,7 @@ import MissingIndicator from 'pl-fe/components/missing-indicator';
|
||||
import SiteLogo from 'pl-fe/components/site-logo';
|
||||
import Status from 'pl-fe/components/status';
|
||||
import { Spinner } from 'pl-fe/components/ui';
|
||||
import { useAppDispatch, useAppSelector } from 'pl-fe/hooks';
|
||||
import { useAppDispatch, useAppSelector, useLogo } from 'pl-fe/hooks';
|
||||
import { iframeId } from 'pl-fe/iframe';
|
||||
import { makeGetStatus } from 'pl-fe/selectors';
|
||||
|
||||
@@ -23,6 +23,7 @@ const EmbeddedStatus: React.FC<IEmbeddedStatus> = ({ params }) => {
|
||||
const history = useHistory();
|
||||
const getStatus = useCallback(makeGetStatus(), []);
|
||||
const intl = useIntl();
|
||||
const logoSrc = useLogo();
|
||||
|
||||
const status = useAppSelector(state => getStatus(state, { id: params.statusId }));
|
||||
|
||||
@@ -46,7 +47,7 @@ const EmbeddedStatus: React.FC<IEmbeddedStatus> = ({ params }) => {
|
||||
}, '*');
|
||||
}, [status, loading]);
|
||||
|
||||
const logo = (
|
||||
const logo = logoSrc && (
|
||||
<div className='ml-4 flex justify-center align-middle'>
|
||||
<SiteLogo className='max-h-[20px] max-w-[112px]' />
|
||||
</div>
|
||||
@@ -56,7 +57,7 @@ const EmbeddedStatus: React.FC<IEmbeddedStatus> = ({ params }) => {
|
||||
if (loading) {
|
||||
return <Spinner />;
|
||||
} else if (status) {
|
||||
return <Status status={status} accountAction={logo} variant='default' />;
|
||||
return <Status status={status} accountAction={logo || undefined} variant='default' />;
|
||||
} else {
|
||||
return <MissingIndicator nested />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user