ыввы
This commit is contained in:
@@ -1,19 +1,32 @@
|
||||
import Box from '@mui/material/Box'
|
||||
import type { SxProps, Theme } from '@mui/material/styles'
|
||||
import type { ColorScheme } from '@/shared/model/theme'
|
||||
|
||||
const HUE_ROTATE: Record<ColorScheme, string> = {
|
||||
craft: 'none',
|
||||
forest: 'hue-rotate(-65deg) saturate(1.3)',
|
||||
ocean: 'hue-rotate(-25deg) saturate(1.15)',
|
||||
berry: 'hue-rotate(80deg) saturate(1.1)',
|
||||
}
|
||||
|
||||
type BearLogoProps = {
|
||||
scheme?: ColorScheme
|
||||
sx?: SxProps<Theme>
|
||||
}
|
||||
|
||||
export function BearLogo({ sx }: BearLogoProps) {
|
||||
export function BearLogo({ scheme, sx }: BearLogoProps) {
|
||||
const filter = scheme ? HUE_ROTATE[scheme] : undefined
|
||||
|
||||
return (
|
||||
<Box
|
||||
component="img"
|
||||
src="/logo.webp"
|
||||
alt="Любимый Креатив"
|
||||
alt=""
|
||||
width={35}
|
||||
height={35}
|
||||
sx={{
|
||||
objectFit: 'contain',
|
||||
transform: 'scale(1.25)',
|
||||
...(filter && filter !== 'none' ? { filter } : {}),
|
||||
...sx,
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -49,7 +49,17 @@ export const OptimizedImage = React.memo(function OptimizedImage({
|
||||
|
||||
// If src is not an upload URL, render a plain img
|
||||
if (!srcSet) {
|
||||
return <Box component="img" src={src} alt={alt} loading={priority ? 'eager' : 'lazy'} decoding="async" sx={sx} />
|
||||
return (
|
||||
<Box
|
||||
component="img"
|
||||
src={src}
|
||||
alt={alt}
|
||||
loading={priority ? 'eager' : 'lazy'}
|
||||
fetchPriority={priority ? 'high' : undefined}
|
||||
decoding="async"
|
||||
sx={sx}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const sizesAttr = sizes ?? '(max-width: 600px) 320px, (max-width: 1024px) 640px, 1024px'
|
||||
@@ -63,6 +73,7 @@ export const OptimizedImage = React.memo(function OptimizedImage({
|
||||
src={fallbackSrc}
|
||||
alt={alt}
|
||||
loading={priority ? 'eager' : 'lazy'}
|
||||
fetchPriority={priority ? 'high' : undefined}
|
||||
decoding="async"
|
||||
sx={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block' }}
|
||||
/>
|
||||
|
||||
@@ -43,7 +43,7 @@ export const UserAvatar = React.memo(function UserAvatar({
|
||||
const src = avatarUrl || generatedSrc || ''
|
||||
|
||||
return (
|
||||
<Avatar src={src} sx={{ width: size, height: size, bgcolor: 'primary.main', ...sx }}>
|
||||
<Avatar src={src} alt="" sx={{ width: size, height: size, bgcolor: 'primary.main', ...sx }}>
|
||||
{!src && '?'}
|
||||
</Avatar>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user