fix(fe/panel_sharings): normalize styles and clean up
This commit is contained in:
parent
9995c94883
commit
10079fc30f
6 changed files with 82 additions and 86 deletions
|
@ -449,6 +449,15 @@
|
||||||
display: block;
|
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 {
|
.desc-l {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
line-height: 3.2rem;
|
line-height: 3.2rem;
|
||||||
|
|
|
@ -357,13 +357,13 @@ input:focus {
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-default #sharing-list .info {
|
.theme-default #sharing-list .info {
|
||||||
display: inline-block;
|
float: left;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-default #sharing-list .op {
|
.theme-default #sharing-list .op {
|
||||||
display: inline-block;
|
float: right;
|
||||||
width: 30%;
|
width: 30%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { List, Map } from "immutable";
|
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 { BtnList } from "./control/btn_list";
|
||||||
import { QRCodeIcon } from "./visual/qrcode";
|
import { QRCodeIcon } from "./visual/qrcode";
|
||||||
import { getErrMsg } from "../common/utils";
|
import { getErrMsg } from "../common/utils";
|
||||||
import { alertMsg, confirmMsg } from "../common/env";
|
import { alertMsg } from "../common/env";
|
||||||
import { updater } from "./state_updater";
|
import { updater } from "./state_updater";
|
||||||
import { ICoreState, MsgProps, UIProps } from "./core_state";
|
import { ICoreState, MsgProps, UIProps } from "./core_state";
|
||||||
import { LoginProps } from "./pane_login";
|
import { LoginProps } from "./pane_login";
|
||||||
import { Flexbox } from "./layout/flexbox";
|
import { Flexbox } from "./layout/flexbox";
|
||||||
import { Container } from "./layout/container";
|
import { Container } from "./layout/container";
|
||||||
import { Rows } from "./layout/rows";
|
import { Rows } from "./layout/rows";
|
||||||
|
import { NotFoundBanner } from "./visual/banner_notfound";
|
||||||
|
import { Title } from "./visual/title";
|
||||||
import { shareIDQuery } from "../client/files";
|
import { shareIDQuery } from "../client/files";
|
||||||
import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls";
|
import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls";
|
||||||
import { CronTable } from "../common/cron";
|
import { CronTable } from "../common/cron";
|
||||||
|
@ -100,7 +99,9 @@ export class SharingsPanel extends React.Component<Props, State, {}> {
|
||||||
|
|
||||||
const row1 = (
|
const row1 = (
|
||||||
<div>
|
<div>
|
||||||
<div className="info">{dirPath}</div>
|
<div className="info">
|
||||||
|
<span className="title-m-wrap dark-font">{dirPath}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="op">
|
<div className="op">
|
||||||
<Flexbox
|
<Flexbox
|
||||||
|
@ -113,6 +114,7 @@ export class SharingsPanel extends React.Component<Props, State, {}> {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.deleteSharing(dirPath);
|
this.deleteSharing(dirPath);
|
||||||
}}
|
}}
|
||||||
|
className="button-default"
|
||||||
>
|
>
|
||||||
{this.props.msg.pkg.get("op.cancel")}
|
{this.props.msg.pkg.get("op.cancel")}
|
||||||
</button>,
|
</button>,
|
||||||
|
@ -124,6 +126,7 @@ export class SharingsPanel extends React.Component<Props, State, {}> {
|
||||||
style={{ justifyContent: "flex-end" }}
|
style={{ justifyContent: "flex-end" }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="fix"></div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -159,6 +162,14 @@ export class SharingsPanel extends React.Component<Props, State, {}> {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const title = (
|
||||||
|
<Title
|
||||||
|
title={this.props.msg.pkg.get("browser.share.title")}
|
||||||
|
iconName="RiShareBoxLine"
|
||||||
|
iconColor="black"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
const orderByCallbacks = List([
|
const orderByCallbacks = List([
|
||||||
() => {
|
() => {
|
||||||
this.orderBy(this.props.msg.pkg.get("item.path"));
|
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 sharingRows = this.makeRows(this.props.sharingsInfo.sharings);
|
||||||
const view = <Rows rows={sharingRows} />;
|
const view =
|
||||||
const noSharingView = (
|
this.props.sharingsInfo.sharings.size > 0 ? (
|
||||||
<Container>
|
<div>
|
||||||
<Flexbox
|
{orderByButtons}
|
||||||
children={List([
|
<Rows rows={sharingRows} />
|
||||||
<RiCloudOffFill size="4rem" className="margin-r-m red0-font" />,
|
</div>
|
||||||
<span>
|
) : (
|
||||||
<h3 className="title-l">
|
<NotFoundBanner title={this.props.msg.pkg.get("share.404.title")} />
|
||||||
{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 =
|
return (
|
||||||
this.props.sharingsInfo.sharings.size === 0 ? (
|
<div id="sharing-list">
|
||||||
noSharingView
|
|
||||||
) : (
|
|
||||||
<Container>
|
<Container>
|
||||||
<Flexbox
|
{title}
|
||||||
children={List([
|
<div className="hr"></div>
|
||||||
<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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{orderByButtons}
|
|
||||||
{view}
|
{view}
|
||||||
</Container>
|
</Container>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
return <div id="sharing-list">{list}</div>;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,6 @@ import * as React from "react";
|
||||||
import { List } from "immutable";
|
import { List } from "immutable";
|
||||||
import FileSize from "filesize";
|
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 { BtnList } from "./control/btn_list";
|
||||||
import { alertMsg } from "../common/env";
|
import { alertMsg } from "../common/env";
|
||||||
import { getErrMsg } from "../common/utils";
|
import { getErrMsg } from "../common/utils";
|
||||||
|
@ -12,10 +9,10 @@ import { updater } from "./state_updater";
|
||||||
import { ICoreState, MsgProps, UIProps } from "./core_state";
|
import { ICoreState, MsgProps, UIProps } from "./core_state";
|
||||||
import { LoginProps } from "./pane_login";
|
import { LoginProps } from "./pane_login";
|
||||||
import { UploadEntry, UploadState } from "../worker/interface";
|
import { UploadEntry, UploadState } from "../worker/interface";
|
||||||
import { Flexbox } from "./layout/flexbox";
|
|
||||||
import { Container } from "./layout/container";
|
import { Container } from "./layout/container";
|
||||||
import { Rows } from "./layout/rows";
|
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 { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls";
|
||||||
import { HotkeyHandler } from "../common/hotkeys";
|
import { HotkeyHandler } from "../common/hotkeys";
|
||||||
|
|
||||||
|
@ -193,23 +190,10 @@ export class UploadingsPanel extends React.Component<Props, State, {}> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const title = (
|
const title = (
|
||||||
<Flexbox
|
<Title
|
||||||
children={List([
|
title={this.props.msg.pkg.get("browser.upload.title")}
|
||||||
<Flexbox
|
iconName="RiUploadCloudFill"
|
||||||
children={List([
|
iconColor="black"
|
||||||
<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>,
|
|
||||||
])}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
32
src/client/web/src/components/visual/title.tsx
Normal file
32
src/client/web/src/components/visual/title.tsx
Normal file
|
@ -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>,
|
||||||
|
])}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue