Improvements for sensitive content overlay for too long posts

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
vite
marcin mikołajczak 2023-01-15 23:05:04 +01:00
rodzic d481f3d7c6
commit 9611509a7e
2 zmienionych plików z 56 dodań i 54 usunięć

Wyświetl plik

@ -103,7 +103,7 @@ const StatusContent: React.FC<IStatusContent> = ({ status, onClick, collapsable
const maybeSetCollapsed = (): void => { const maybeSetCollapsed = (): void => {
if (!node.current) return; if (!node.current) return;
if (collapsable && onClick && !collapsed && status.spoiler_text.length === 0) { if (collapsable && onClick && !collapsed) {
if (node.current.clientHeight > MAX_HEIGHT) { if (node.current.clientHeight > MAX_HEIGHT) {
setCollapsed(true); setCollapsed(true);
} }

Wyświetl plik

@ -92,7 +92,7 @@ const SensitiveContentOverlay = React.forwardRef<HTMLDivElement, ISensitiveConte
return ( return (
<div <div
className={classNames('absolute z-40', { className={classNames('absolute z-40', {
'cursor-default backdrop-blur-lg rounded-lg w-full h-full border-0 flex justify-center items-center': !visible, 'cursor-default backdrop-blur-lg rounded-lg w-full h-full border-0 flex justify-center': !visible,
'bg-gray-800/75 inset-0': !visible, 'bg-gray-800/75 inset-0': !visible,
'bottom-1 right-1': visible, 'bottom-1 right-1': visible,
})} })}
@ -107,6 +107,7 @@ const SensitiveContentOverlay = React.forwardRef<HTMLDivElement, ISensitiveConte
size='sm' size='sm'
/> />
) : ( ) : (
<div className='flex justify-center items-center max-h-screen'>
<div className='text-center w-3/4 mx-auto space-y-4' ref={ref}> <div className='text-center w-3/4 mx-auto space-y-4' ref={ref}>
<div className='space-y-1'> <div className='space-y-1'>
<Text theme='white' weight='semibold'> <Text theme='white' weight='semibold'>
@ -166,6 +167,7 @@ const SensitiveContentOverlay = React.forwardRef<HTMLDivElement, ISensitiveConte
) : null} ) : null}
</HStack> </HStack>
</div> </div>
</div>
)} )}
</div> </div>
); );