diff --git a/public/static/css/default.css b/public/static/css/default.css index a2b68cd..aaf66a8 100644 --- a/public/static/css/default.css +++ b/public/static/css/default.css @@ -449,6 +449,15 @@ display: block; } +.title-l-wrap { + font-size: 1.8rem; + font-weight: bold; + line-height: 3.2rem; + overflow: hidden; + overflow-wrap: break-word; + display: block; +} + .desc-l { font-size: 1.2rem; line-height: 3.2rem; @@ -597,4 +606,4 @@ .work-break-all { word-break: break-all; -} \ No newline at end of file +} diff --git a/public/static/css/white.css b/public/static/css/white.css index a069aad..a312a9c 100644 --- a/public/static/css/white.css +++ b/public/static/css/white.css @@ -357,13 +357,13 @@ input:focus { } .theme-default #sharing-list .info { - display: inline-block; + float: left; width: 70%; overflow-wrap: break-word; } .theme-default #sharing-list .op { - display: inline-block; + float: right; width: 30%; text-align: right; } diff --git a/src/client/web/src/components/panel_sharings.tsx b/src/client/web/src/components/panel_sharings.tsx index 9dbdc32..5667789 100644 --- a/src/client/web/src/components/panel_sharings.tsx +++ b/src/client/web/src/components/panel_sharings.tsx @@ -1,19 +1,18 @@ import * as React from "react"; import { List, Map } from "immutable"; -import { RiShareBoxLine } from "@react-icons/all-files/ri/RiShareBoxLine"; -import { RiCloudOffFill } from "@react-icons/all-files/ri/RiCloudOffFill"; - import { BtnList } from "./control/btn_list"; import { QRCodeIcon } from "./visual/qrcode"; import { getErrMsg } from "../common/utils"; -import { alertMsg, confirmMsg } from "../common/env"; +import { alertMsg } from "../common/env"; import { updater } from "./state_updater"; import { ICoreState, MsgProps, UIProps } from "./core_state"; import { LoginProps } from "./pane_login"; import { Flexbox } from "./layout/flexbox"; import { Container } from "./layout/container"; import { Rows } from "./layout/rows"; +import { NotFoundBanner } from "./visual/banner_notfound"; +import { Title } from "./visual/title"; import { shareIDQuery } from "../client/files"; import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls"; import { CronTable } from "../common/cron"; @@ -100,7 +99,9 @@ export class SharingsPanel extends React.Component { const row1 = (
-
{dirPath}
+
+ {dirPath} +
{ onClick={() => { this.deleteSharing(dirPath); }} + className="button-default" > {this.props.msg.pkg.get("op.cancel")} , @@ -124,6 +126,7 @@ export class SharingsPanel extends React.Component { style={{ justifyContent: "flex-end" }} />
+
); @@ -159,6 +162,14 @@ export class SharingsPanel extends React.Component { }; render() { + const title = ( + + ); + const orderByCallbacks = List([ () => { this.orderBy(this.props.msg.pkg.get("item.path")); @@ -173,64 +184,24 @@ export class SharingsPanel extends React.Component<Props, State, {}> { ); const sharingRows = this.makeRows(this.props.sharingsInfo.sharings); - const view = <Rows rows={sharingRows} />; - const noSharingView = ( - <Container> - <Flexbox - children={List([ - <RiCloudOffFill size="4rem" className="margin-r-m red0-font" />, - <span> - <h3 className="title-l"> - {this.props.msg.pkg.get("share.404.title")} - </h3> - <span className="desc-l grey0-font"> - {this.props.msg.pkg.get("share.404.desc")} - </span> - </span>, - ])} - childrenStyles={List([ - { flex: "auto", justifyContent: "flex-end" }, - { flex: "auto" }, - ])} - /> - </Container> - ); - - const list = - this.props.sharingsInfo.sharings.size === 0 ? ( - noSharingView - ) : ( - <Container> - <Flexbox - children={List([ - <Flexbox - children={List([ - <RiShareBoxLine - size="3rem" - className="margin-r-m black-font" - />, - - <span> - <span className="title-m bold"> - {this.props.msg.pkg.get("browser.share.title")} - </span> - <span className="desc-m grey0-font"> - {this.props.msg.pkg.get("browser.share.desc")} - </span> - </span>, - ])} - />, - - <span></span>, - ])} - className="margin-b-l" - /> - + const view = + this.props.sharingsInfo.sharings.size > 0 ? ( + <div> {orderByButtons} - {view} - </Container> + <Rows rows={sharingRows} /> + </div> + ) : ( + <NotFoundBanner title={this.props.msg.pkg.get("share.404.title")} /> ); - return <div id="sharing-list">{list}</div>; + return ( + <div id="sharing-list"> + <Container> + {title} + <div className="hr"></div> + {view} + </Container> + </div> + ); } } diff --git a/src/client/web/src/components/panel_uploadings.tsx b/src/client/web/src/components/panel_uploadings.tsx index 920b68a..5982399 100644 --- a/src/client/web/src/components/panel_uploadings.tsx +++ b/src/client/web/src/components/panel_uploadings.tsx @@ -2,9 +2,6 @@ import * as React from "react"; import { List } from "immutable"; import FileSize from "filesize"; -import { RiUploadCloudFill } from "@react-icons/all-files/ri/RiUploadCloudFill"; -import { RiCloudOffFill } from "@react-icons/all-files/ri/RiCloudOffFill"; - import { BtnList } from "./control/btn_list"; import { alertMsg } from "../common/env"; import { getErrMsg } from "../common/utils"; @@ -12,10 +9,10 @@ import { updater } from "./state_updater"; import { ICoreState, MsgProps, UIProps } from "./core_state"; import { LoginProps } from "./pane_login"; import { UploadEntry, UploadState } from "../worker/interface"; -import { Flexbox } from "./layout/flexbox"; import { Container } from "./layout/container"; import { Rows } from "./layout/rows"; -import { NotFoundBanner } from "./visual/notfound"; +import { NotFoundBanner } from "./visual/banner_notfound"; +import { Title } from "./visual/title"; import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls"; import { HotkeyHandler } from "../common/hotkeys"; @@ -193,23 +190,10 @@ export class UploadingsPanel extends React.Component<Props, State, {}> { render() { const title = ( - <Flexbox - children={List([ - <Flexbox - children={List([ - <RiUploadCloudFill - size="3.2rem" - className="margin-r-m black-font" - />, - - <span className="title-m bold"> - {this.props.msg.pkg.get("browser.upload.title")} - </span>, - ])} - />, - - <span></span>, - ])} + <Title + title={this.props.msg.pkg.get("browser.upload.title")} + iconName="RiUploadCloudFill" + iconColor="black" /> ); diff --git a/src/client/web/src/components/visual/notfound.tsx b/src/client/web/src/components/visual/banner_notfound.tsx similarity index 100% rename from src/client/web/src/components/visual/notfound.tsx rename to src/client/web/src/components/visual/banner_notfound.tsx diff --git a/src/client/web/src/components/visual/title.tsx b/src/client/web/src/components/visual/title.tsx new file mode 100644 index 0000000..8fd0dd2 --- /dev/null +++ b/src/client/web/src/components/visual/title.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { List } from "immutable"; + +import { Flexbox } from "../layout/flexbox"; +import { getIconWithProps } from "./icons"; +import { colorClass } from "./colors"; + +export interface Props { + iconName: string; + iconColor: string; + title: string; +} + +export const Title = (props: Props) => { + return ( + <Flexbox + children={List([ + <Flexbox + children={List([ + getIconWithProps(props.iconName, { + size: "3.2rem", + className: `margin-r-m ${colorClass(props.iconColor)}-font`, + }), + <span className="title-m bold">{props.title}</span>, + ])} + />, + + <span></span>, + ])} + /> + ); +};