From 6bd53436738bb9b0b65123d8f264903642643ccf Mon Sep 17 00:00:00 2001 From: hexxa Date: Sun, 27 Feb 2022 10:50:14 +0800 Subject: [PATCH] fix(fe/panels): remove redundant code --- .../web/src/components/pane_settings.tsx | 2 - src/client/web/src/components/panel_files.tsx | 6 -- .../web/src/components/panel_sharings.tsx | 95 +++++++++---------- .../web/src/components/panel_uploadings.tsx | 13 +-- 4 files changed, 45 insertions(+), 71 deletions(-) diff --git a/src/client/web/src/components/pane_settings.tsx b/src/client/web/src/components/pane_settings.tsx index 1ddaaa0..ea20e47 100644 --- a/src/client/web/src/components/pane_settings.tsx +++ b/src/client/web/src/components/pane_settings.tsx @@ -180,8 +180,6 @@ export class PaneSettings extends React.Component {
); - // const val = clientErr; - // const sortVals = List([]); errRows = errRows.push(elem); }); diff --git a/src/client/web/src/components/panel_files.tsx b/src/client/web/src/components/panel_files.tsx index 5514739..fb16b6a 100644 --- a/src/client/web/src/components/panel_files.tsx +++ b/src/client/web/src/components/panel_files.tsx @@ -751,13 +751,7 @@ export class FilesPanel extends React.Component { ); - // const sortVals = List([item.isDir ? "d" : "f", itemPath]); return elem; - // return { - // elem, - // sortVals, - // val: item, - // }; }); return ; diff --git a/src/client/web/src/components/panel_sharings.tsx b/src/client/web/src/components/panel_sharings.tsx index 03bf2a9..7e2317e 100644 --- a/src/client/web/src/components/panel_sharings.tsx +++ b/src/client/web/src/components/panel_sharings.tsx @@ -13,7 +13,7 @@ import { ICoreState, MsgProps, UIProps } from "./core_state"; import { LoginProps } from "./pane_login"; import { Flexbox } from "./layout/flexbox"; import { Container } from "./layout/container"; -import { Rows, Row } from "./layout/rows"; +import { Rows } from "./layout/rows"; import { shareIDQuery } from "../client/files"; import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls"; import { CronTable } from "../common/cron"; @@ -90,56 +90,53 @@ export class SharingsPanel extends React.Component { }; makeRows = (sharings: Map): List => { - const sharingRows = sharings.keySeq().map((dirPath: string):React.ReactNode => { - const shareID = sharings.get(dirPath); - const sharingURL = `${ - document.location.href.split("?")[0] - }?${shareIDQuery}=${shareID}`; + const sharingRows = sharings + .keySeq() + .map((dirPath: string): React.ReactNode => { + const shareID = sharings.get(dirPath); + const sharingURL = `${ + document.location.href.split("?")[0] + }?${shareIDQuery}=${shareID}`; - const row1 = ( -
-
{dirPath}
+ const row1 = ( +
+
{dirPath}
-
- - - , +
+ + + , - , - ])} - childrenStyles={List([ - { flex: "0 0 auto" }, - { flex: "0 0 auto" }, - ])} - style={{ justifyContent: "flex-end" }} - /> + , + ])} + childrenStyles={List([ + { flex: "0 0 auto" }, + { flex: "0 0 auto" }, + ])} + style={{ justifyContent: "flex-end" }} + /> +
-
- ); + ); - const elem = ( -
- {row1} -
{sharingURL}
-
-
- ); + const elem = ( +
+ {row1} +
{sharingURL}
+
+
+ ); - return elem; - // return { - // elem, - // sortVals: List([dirPath]), - // val: dirPath, - // }; - }); + return elem; + }); return sharingRows.toList(); }; @@ -175,13 +172,7 @@ export class SharingsPanel extends React.Component { ); const sharingRows = this.makeRows(this.props.sharingsInfo.sharings); - const view = ( - - ); + const view = ; const noSharingView = ( {
); - // file path - // const sortVals = List([uploading.filePath]); return elem; }); }; @@ -207,14 +205,7 @@ export class UploadingsPanel extends React.Component { const uploadingRows = this.makeRowsInputs( this.props.uploadingsInfo.uploadings ); - // const sortKeys = List([this.props.msg.pkg.get("item.path")]); - const view = ( - - ); + const view = ; const noUploadingView = (