From 15aaa2b3c30b5757971220914fb3ef085bbafff9 Mon Sep 17 00:00:00 2001 From: DaneEveritt Date: Sun, 3 Jul 2022 14:44:00 -0400 Subject: [PATCH] Fix display issues due to removal of quirks mode --- .../components/dashboard/ServerRow.tsx | 2 +- .../components/elements/GreyRowBox.tsx | 2 +- .../server/files/FileDropdownMenu.tsx | 2 +- .../components/server/files/FileObjectRow.tsx | 19 +++++++------------ .../server/files/SelectFileCheckbox.tsx | 2 +- .../components/server/files/style.module.css | 13 +++++++++++++ 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/resources/scripts/components/dashboard/ServerRow.tsx b/resources/scripts/components/dashboard/ServerRow.tsx index 8336e67f8..08637bfc2 100644 --- a/resources/scripts/components/dashboard/ServerRow.tsx +++ b/resources/scripts/components/dashboard/ServerRow.tsx @@ -91,7 +91,7 @@ export default ({ server, className }: { server: Server; className?: string }) = return (
-
+
diff --git a/resources/scripts/components/elements/GreyRowBox.tsx b/resources/scripts/components/elements/GreyRowBox.tsx index cf7413013..e5a7f9685 100644 --- a/resources/scripts/components/elements/GreyRowBox.tsx +++ b/resources/scripts/components/elements/GreyRowBox.tsx @@ -7,6 +7,6 @@ export default styled.div<{ $hoverable?: boolean }>` ${(props) => props.$hoverable !== false && tw`hover:border-neutral-500`}; & .icon { - ${tw`rounded-full bg-neutral-500 p-3`}; + ${tw`rounded-full w-16 flex items-center justify-center bg-neutral-500 p-3`}; } `; diff --git a/resources/scripts/components/server/files/FileDropdownMenu.tsx b/resources/scripts/components/server/files/FileDropdownMenu.tsx index 5b2ad8e31..fd892951d 100644 --- a/resources/scripts/components/server/files/FileDropdownMenu.tsx +++ b/resources/scripts/components/server/files/FileDropdownMenu.tsx @@ -142,7 +142,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => { ( -
+
{modal ? ( modal === 'chmod' ? ( diff --git a/resources/scripts/components/server/files/FileObjectRow.tsx b/resources/scripts/components/server/files/FileObjectRow.tsx index 2d92aeecc..8032dab1e 100644 --- a/resources/scripts/components/server/files/FileObjectRow.tsx +++ b/resources/scripts/components/server/files/FileObjectRow.tsx @@ -9,15 +9,11 @@ import { ServerContext } from '@/state/server'; import { NavLink, useRouteMatch } from 'react-router-dom'; import tw from 'twin.macro'; import isEqual from 'react-fast-compare'; -import styled from 'styled-components/macro'; import SelectFileCheckbox from '@/components/server/files/SelectFileCheckbox'; import { usePermissions } from '@/plugins/usePermissions'; import { join } from 'path'; import { bytesToString } from '@/lib/formatters'; - -const Row = styled.div` - ${tw`flex bg-neutral-700 rounded-sm mb-px text-sm hover:text-neutral-100 cursor-pointer items-center no-underline hover:bg-neutral-600`}; -`; +import styles from './style.module.css'; const Clickable: React.FC<{ file: FileObject }> = memo(({ file, children }) => { const [canReadContents] = usePermissions(['file.read-content']); @@ -26,13 +22,11 @@ const Clickable: React.FC<{ file: FileObject }> = memo(({ file, children }) => { const match = useRouteMatch(); return !canReadContents || (file.isFile && !file.isEditable()) ? ( -
- {children} -
+
{children}
) : ( {children} @@ -40,7 +34,8 @@ const Clickable: React.FC<{ file: FileObject }> = memo(({ file, children }) => { }, isEqual); const FileObjectRow = ({ file }: { file: FileObject }) => ( - { e.preventDefault(); @@ -49,7 +44,7 @@ const FileObjectRow = ({ file }: { file: FileObject }) => ( > -
+
{file.isFile ? ( (
- +
); export default memo(FileObjectRow, (prevProps, nextProps) => { diff --git a/resources/scripts/components/server/files/SelectFileCheckbox.tsx b/resources/scripts/components/server/files/SelectFileCheckbox.tsx index f0faa5762..1708fd413 100644 --- a/resources/scripts/components/server/files/SelectFileCheckbox.tsx +++ b/resources/scripts/components/server/files/SelectFileCheckbox.tsx @@ -20,7 +20,7 @@ export default ({ name }: { name: string }) => { const removeSelectedFile = ServerContext.useStoreActions((actions) => actions.files.removeSelectedFile); return ( -