fix(ui/browser): move breadcrumb to item list

This commit is contained in:
hexxa 2021-08-28 21:40:56 +08:00 committed by Hexxa
parent 74af901857
commit 0c875c30dd
6 changed files with 41 additions and 51 deletions

View file

@ -298,21 +298,18 @@ export class Browser extends React.Component<Props, State, {}> {
}; };
render() { render() {
const breadcrumb = this.props.browser.dirPath.map( let breadcrumb = this.props.browser.dirPath.map(
(pathPart: string, key: number) => { (pathPart: string, key: number) => {
return ( return (
<span key={pathPart}>
<button <button
type="button" key={pathPart}
onClick={() => onClick={() =>
this.chdir(this.props.browser.dirPath.slice(0, key + 1)) this.chdir(this.props.browser.dirPath.slice(0, key + 1))
} }
className="white-font margin-r-m" className="grey3-bg grey4-font margin-r-m"
style={{ backgroundColor: "rgba(0, 0, 0, 0.7)" }}
> >
{pathPart} {pathPart}
</button> </button>
</span>
); );
} }
); );
@ -662,22 +659,6 @@ export class Browser extends React.Component<Props, State, {}> {
</div> </div>
)} )}
<div className="breadcrumb margin-b-l">
<span
className="white-font margin-r-m"
style={{
backgroundColor: "rgba(0, 0, 0, 0.7)",
padding: "0.8rem 1rem",
fontWeight: "bold",
borderRadius: "0.5rem",
}}
>
<RiFolder2Fill size="1.2rem" />
{/* {this.props.msg.pkg.get("browser.location")} */}
</span>
{breadcrumb}
</div>
<div id="op-bar" className="op-bar"> <div id="op-bar" className="op-bar">
<div className="margin-l-m margin-r-m margin-b-m">{ops}</div> <div className="margin-l-m margin-r-m margin-b-m">{ops}</div>
</div> </div>
@ -693,15 +674,18 @@ export class Browser extends React.Component<Props, State, {}> {
className="margin-r-m black-font" className="margin-r-m black-font"
/>, />,
<span> // <span>
<span className="title-l"> // <span className="title-l">
{this.props.msg.pkg.get("browser.item.title")} // {this.props.msg.pkg.get("browser.item.title")}
</span> // </span>
<span className="desc-l grey0-font"> // <span className="desc-l grey0-font">
Files and folders in current path // Files and folders in current path
</span> // </span>
</span>, // </span>,
<Flexbox children={breadcrumb} />,
])} ])}
// style={{ flex: "column nowrap" }}
/> />
</span>, </span>,

View file

@ -181,7 +181,7 @@ export class UserForm extends React.Component<
> >
<button <button
onClick={this.delUser} onClick={this.delUser}
className="grey1-bg white-font margin-r-m" className="margin-r-m"
> >
{this.props.msg.pkg.get("delete")} {this.props.msg.pkg.get("delete")}
</button> </button>
@ -251,7 +251,7 @@ export class UserForm extends React.Component<
<div className="flex-list-item-r"> <div className="flex-list-item-r">
<button <button
onClick={this.setUser} onClick={this.setUser}
className="grey1-bg white-font margin-r-m" className="margin-r-m"
> >
{this.props.msg.pkg.get("update")} {this.props.msg.pkg.get("update")}
</button> </button>
@ -288,7 +288,7 @@ export class UserForm extends React.Component<
<div className="flex-list-item-r"> <div className="flex-list-item-r">
<button <button
onClick={this.setPwd} onClick={this.setPwd}
className="grey1-bg white-font margin-r-m" className="margin-r-m"
> >
{this.props.msg.pkg.get("update")} {this.props.msg.pkg.get("update")}
</button> </button>
@ -437,7 +437,7 @@ export class AdminPane extends React.Component<Props, State, {}> {
onClick={() => { onClick={() => {
this.delRole(role); this.delRole(role);
}} }}
className="grey1-bg white-font margin-r-m" className="margin-r-m"
> >
{this.props.msg.pkg.get("delete")} {this.props.msg.pkg.get("delete")}
</button> </button>
@ -497,7 +497,7 @@ export class AdminPane extends React.Component<Props, State, {}> {
<div className="flex-list-item-r"> <div className="flex-list-item-r">
<button <button
onClick={this.addUser} onClick={this.addUser}
className="grey1-bg white-font margin-r-m" className="margin-r-m"
> >
{this.props.msg.pkg.get("add")} {this.props.msg.pkg.get("add")}
</button> </button>
@ -542,7 +542,7 @@ export class AdminPane extends React.Component<Props, State, {}> {
<div className="flex-list-item-r"> <div className="flex-list-item-r">
<button <button
onClick={this.addRole} onClick={this.addRole}
className="grey1-bg white-font margin-r-m" className="margin-r-m"
> >
{this.props.msg.pkg.get("add")} {this.props.msg.pkg.get("add")}
</button> </button>

View file

@ -167,7 +167,7 @@ export class AuthPane extends React.Component<Props, State, {}> {
</div> </div>
<span style={{ display: this.props.login.authed ? "inherit" : "none" }}> <span style={{ display: this.props.login.authed ? "inherit" : "none" }}>
<button onClick={this.logout} className="grey1-bg white-font"> <button onClick={this.logout}>
{this.props.msg.pkg.get("login.logout")} {this.props.msg.pkg.get("login.logout")}
</button> </button>
</span> </span>

View file

@ -80,7 +80,7 @@ export class PaneSettings extends React.Component<Props, State, {}> {
</h5> </h5>
</div> </div>
<div className="flex-list-item-r"> <div className="flex-list-item-r">
<button onClick={this.setPwd} className="grey1-bg white-font"> <button onClick={this.setPwd}>
{this.props.msg.pkg.get("update")} {this.props.msg.pkg.get("update")}
</button> </button>
</div> </div>
@ -130,7 +130,7 @@ export class PaneSettings extends React.Component<Props, State, {}> {
onClick={() => { onClick={() => {
this.setLan("en_US"); this.setLan("en_US");
}} }}
className="margin-r-m white-font" className="margin-r-m"
> >
{this.props.msg.pkg.get("enUS")} {this.props.msg.pkg.get("enUS")}
</button> </button>
@ -138,7 +138,6 @@ export class PaneSettings extends React.Component<Props, State, {}> {
onClick={() => { onClick={() => {
this.setLan("zh_CN"); this.setLan("zh_CN");
}} }}
className="white-font"
> >
{this.props.msg.pkg.get("zhCN")} {this.props.msg.pkg.get("zhCN")}
</button> </button>

View file

@ -42,11 +42,12 @@ export class TopBar extends React.Component<Props, State, {}> {
this.props.login.userRole === "admin" ? ( this.props.login.userRole === "admin" ? (
<button <button
onClick={this.showAdmin} onClick={this.showAdmin}
className="grey1-bg white-font margin-r-m" className="grey3-bg grey4-font margin-r-m"
> >
{this.props.msg.pkg.get("admin")} {this.props.msg.pkg.get("admin")}
</button> </button>
) : null; ) : null;
return ( return (
<div <div
id="top-bar" id="top-bar"
@ -60,10 +61,16 @@ export class TopBar extends React.Component<Props, State, {}> {
Quickshare Quickshare
</a> </a>
<span className="flex-23col text-right"> <span className="flex-23col text-right">
<span className="user margin-r-m">{this.props.login.userName}</span> <span className="grey3-font font-s">
{this.props.login.userName}
</span>
&nbsp;-&nbsp;
<span className="grey0-font font-s margin-r-m">
{this.props.login.userRole}
</span>
<button <button
onClick={this.showSettings} onClick={this.showSettings}
className="grey1-bg white-font margin-r-m" className="grey3-bg grey4-font margin-r-m"
> >
{this.props.msg.pkg.get("settings")} {this.props.msg.pkg.get("settings")}
</button> </button>

View file

@ -55,7 +55,7 @@ export const msgs: Map<string, string> = Map({
"user.id": "用户ID", "user.id": "用户ID",
"user.add": "新增用户", "user.add": "新增用户",
"user.name": "用户名", "user.name": "用户名",
"user.role": "色", "user.role": "色",
"user.password": "密码", "user.password": "密码",
add: "新增", add: "新增",
"admin.users": "用户列表", "admin.users": "用户列表",