SiteLogo: never, under any circumstances, squish the logo

merge-requests/1389/head
Alex Gleason 2022-05-15 22:30:48 -05:00
rodzic 379fb61cd4
commit 2a12e29235
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -1,9 +1,15 @@
import classNames from 'classnames';
import React from 'react';
import { useSoapboxConfig, useSettings, useSystemTheme } from 'soapbox/hooks';
interface ISiteLogo extends React.ComponentProps<'img'> {
/** Extra class names for the <img> element. */
className?: string,
}
/** Display the most appropriate site logo based on the theme and configuration. */
const SiteLogo: React.FC<React.ComponentProps<'img'>> = (props) => {
const SiteLogo: React.FC<ISiteLogo> = ({ className, ...rest }) => {
const { logo, logoDarkMode } = useSoapboxConfig();
const settings = useSettings();
@ -28,7 +34,11 @@ const SiteLogo: React.FC<React.ComponentProps<'img'>> = (props) => {
return (
// eslint-disable-next-line jsx-a11y/alt-text
<img src={getSrc()} {...props} />
<img
className={classNames('object-contain', className)}
src={getSrc()}
{...rest}
/>
);
};