💄 front: fix file browser vertical borders (and fix react warning) (#645)

This commit is contained in:
Eric Doughty-Papassideris
2024-10-10 22:48:52 +02:00
parent a669e81113
commit e91aa652e7
3 changed files with 8 additions and 8 deletions
@@ -227,8 +227,8 @@ export default memo(
const commonProps = { const commonProps = {
key: index, key: index,
className: className:
(index === 0 ? 'rounded-t-md ' : '') + (index === 0 ? 'rounded-t-md ' : '-mt-px ') +
(index === documents.length - 1 ? 'rounded-b-md ' : ''), (index === items.length - 1 ? 'rounded-b-md ' : ''),
item: child, item: child,
checked: checked[child.id] || false, checked: checked[child.id] || false,
onCheck: (v: boolean) => setChecked(_.pickBy({ ...checked, [child.id]: v }, _.identity)), onCheck: (v: boolean) => setChecked(_.pickBy({ ...checked, [child.id]: v }, _.identity)),
@@ -238,7 +238,7 @@ export default memo(
return isMobile ? ( return isMobile ? (
<DocumentRow {...commonProps} /> <DocumentRow {...commonProps} />
) : ( ) : (
<Draggable id={index}> <Draggable id={index} key={index}>
<DocumentRow {...commonProps} /> <DocumentRow {...commonProps} />
</Draggable> </Draggable>
); );
@@ -450,7 +450,7 @@ export default memo(
<FolderRow <FolderRow
key={index} key={index}
className={ className={
(index === 0 ? 'rounded-t-md ' : '') + (index === 0 ? 'rounded-t-md ' : '-mt-px ') +
(index === items.length - 1 ? 'rounded-b-md ' : '') (index === items.length - 1 ? 'rounded-b-md ' : '')
} }
item={child} item={child}
@@ -476,7 +476,7 @@ export default memo(
{activeIndex ? ( {activeIndex ? (
<DocumentRowOverlay <DocumentRowOverlay
className={ className={
(activeIndex === 0 ? 'rounded-t-md ' : '') + (activeIndex === 0 ? 'rounded-t-md ' : '-mt-px ') +
(activeIndex === items.length - 1 ? 'rounded-b-md ' : '') (activeIndex === items.length - 1 ? 'rounded-b-md ' : '')
} }
item={activeChild} item={activeChild}
@@ -39,7 +39,7 @@ export const DocumentRow = ({
return ( return (
<div <div
className={ className={
'flex flex-row items-center border border-zinc-200 dark:border-zinc-800 -mt-px px-4 py-3 cursor-pointer ' + 'flex flex-row items-center border border-zinc-200 dark:border-zinc-800 px-4 py-3 cursor-pointer ' +
(checked (checked
? 'bg-blue-500 bg-opacity-10 hover:bg-opacity-25 ' ? 'bg-blue-500 bg-opacity-10 hover:bg-opacity-25 '
: 'hover:bg-zinc-500 hover:bg-opacity-10 ') + : 'hover:bg-zinc-500 hover:bg-opacity-10 ') +
@@ -96,7 +96,7 @@ export const DocumentRowOverlay = ({ item, className }: DriveItemOverlayProps) =
return ( return (
<div <div
className={ className={
'flex flex-row items-center border border-zinc-200 dark:border-zinc-800 -mt-px px-4 py-3 cursor-pointer ' + 'flex flex-row items-center border border-zinc-200 dark:border-zinc-800 px-4 py-3 cursor-pointer ' +
(className || '') (className || '')
} }
> >
@@ -23,7 +23,7 @@ export const FolderRow = ({
return ( return (
<div <div
className={ className={
'flex flex-row items-center border border-zinc-200 dark:border-zinc-800 -mt-px px-4 py-3 cursor-pointer ' + 'flex flex-row items-center border border-zinc-200 dark:border-zinc-800 px-4 py-3 cursor-pointer ' +
(className || '') + (className || '') +
(checked (checked
? 'bg-blue-500 bg-opacity-10 hover:bg-opacity-25 ' ? 'bg-blue-500 bg-opacity-10 hover:bg-opacity-25 '