From ba965aa7647055ce0f2995fb0d3c20fe69d8dd2f Mon Sep 17 00:00:00 2001 From: hexxa Date: Fri, 18 Mar 2022 21:02:40 +0800 Subject: [PATCH] fix(fe/panel_files): normalize styles and clean up --- public/static/css/default.css | 20 +++++++++++++++ public/static/css/white.css | 11 ++------ public/static/css/white_compact.css | 6 +++++ src/client/web/src/components/panel_files.tsx | 25 +++++++++++-------- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/public/static/css/default.css b/public/static/css/default.css index aaf66a8..6f726bd 100644 --- a/public/static/css/default.css +++ b/public/static/css/default.css @@ -607,3 +607,23 @@ .work-break-all { word-break: break-all; } + +.icon-s { + height: 2rem; + padding: 0.6rem 0; +} + +.icon-m { + height: 2.4rem; + padding: 0.4rem 0; +} + +.icon-l { + height: 3.2rem; + padding: 0; +} + +.no-height { + height: 0; + overflow: hidden; +} diff --git a/public/static/css/white.css b/public/static/css/white.css index a312a9c..fe1b3d9 100644 --- a/public/static/css/white.css +++ b/public/static/css/white.css @@ -24,11 +24,12 @@ background-color: #ecf0f6; } .highlight-bg { - color: #16a085; + background-color: #16a085; } .dark-bg { background-color: #2c3e50; } + button { background-color: rgba(0, 0, 0, 0.3); } @@ -249,14 +250,6 @@ input:focus { word-break: break-all; } */ -.theme-default #item-rows .desc { - display: block; - word-break: break-all; - padding: 2rem; - margin-top: 1rem; - border-radius: 0.8rem; -} - .theme-default #item-rows .hr { height: 1px; margin: 2rem 0; diff --git a/public/static/css/white_compact.css b/public/static/css/white_compact.css index 2872209..de66cea 100644 --- a/public/static/css/white_compact.css +++ b/public/static/css/white_compact.css @@ -111,3 +111,9 @@ line-height: 3.2rem; overflow-wrap: break-word; } + +.theme-default #item-rows .desc { + display: block; + word-break: break-all; + border-radius: 0.8rem; +} diff --git a/src/client/web/src/components/panel_files.tsx b/src/client/web/src/components/panel_files.tsx index fd5c436..2f83b43 100644 --- a/src/client/web/src/components/panel_files.tsx +++ b/src/client/web/src/components/panel_files.tsx @@ -6,7 +6,7 @@ import FileSize from "filesize"; import { RiFolder2Fill } from "@react-icons/all-files/ri/RiFolder2Fill"; import { RiFile2Fill } from "@react-icons/all-files/ri/RiFile2Fill"; import { RiCheckboxFill } from "@react-icons/all-files/ri/RiCheckboxFill"; -import { RiMore2Fill } from "@react-icons/all-files/ri/RiMore2Fill"; +import { RiMenuUnfoldFill } from "@react-icons/all-files/ri/RiMenuUnfoldFill"; import { RiRestartFill } from "@react-icons/all-files/ri/RiRestartFill"; import { RiCheckboxBlankLine } from "@react-icons/all-files/ri/RiCheckboxBlankLine"; @@ -529,11 +529,11 @@ export class FilesPanel extends React.Component { ); const op = item.isDir ? ( -
{checkIcon}
+
{checkIcon}
) : ( -
- + this.toggleDetail(item.name)} /> @@ -546,8 +546,12 @@ export class FilesPanel extends React.Component { const modTimeTitle = this.props.msg.pkg.get("item.modTime"); const sizeTitle = this.props.msg.pkg.get("item.size"); const itemSize = FileSize(item.size, { round: 0 }); - const details = ( -
+ + const descStateClass = this.state.showDetail.has(item.name) + ? "margin-t-m padding-m" + : "no-height"; + const desc = ( +
{pathTitle} @@ -584,19 +588,18 @@ export class FilesPanel extends React.Component {
); - const desc = this.state.showDetail.has(item.name) ? details : null; const cells = List([ - icon, +
{icon}
,
{name}
, -
{itemSize}
, +
{itemSize}
,
{op}
, ]); const tableCols = ( );