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

This commit is contained in:
hexxa 2021-08-29 16:53:47 +08:00 committed by Hexxa
parent 1c10fdf140
commit 969cdc8032
2 changed files with 46 additions and 39 deletions

View file

@ -92,7 +92,8 @@ input {
}
input:focus {
background-color: rgba(0, 0, 0, 0.2);
opacity: 0.8;
box-shadow: 0 0.1rem 1rem rgba(0, 0, 0, 0.1);
}
button {

View file

@ -360,44 +360,6 @@ export class Browser extends React.Component<Props, State, {}> {
/>
</span>
</div>
<div className="hr white0-bg margin-t-m margin-b-m"></div>
<div>
<button
type="button"
onClick={() => this.delete()}
className="red0-bg white-font margin-t-m margin-b-m margin-r-m"
>
{this.props.msg.pkg.get("browser.delete")}
</button>
<button
type="button"
onClick={() => this.moveHere()}
className="margin-t-m margin-b-m margin-r-m"
>
{this.props.msg.pkg.get("browser.paste")}
</button>
{this.props.browser.isSharing ? (
<button
type="button"
onClick={() => {
this.deleteSharing(this.props.browser.dirPath.join("/"));
}}
className="red0-bg white-font margin-t-m margin-b-m"
>
{this.props.msg.pkg.get("browser.share.del")}
</button>
) : (
<button
type="button"
onClick={this.addSharing}
className="green0-bg white-font margin-t-m margin-b-m"
>
{this.props.msg.pkg.get("browser.share.add")}
</button>
)}
</div>
</div>
);
@ -512,6 +474,50 @@ export class Browser extends React.Component<Props, State, {}> {
</div>
<div className="container">
<div className="padding-m">
{this.props.browser.isSharing ? (
<button
type="button"
onClick={() => {
this.deleteSharing(this.props.browser.dirPath.join("/"));
}}
className="red0-bg white-font margin-r-m"
>
{this.props.msg.pkg.get("browser.share.del")}
</button>
) : (
<button
type="button"
onClick={this.addSharing}
className="green0-bg white-font margin-r-m"
>
{this.props.msg.pkg.get("browser.share.add")}
</button>
)}
{this.state.selectedItems.size > 0 ? (
<span>
<button
type="button"
onClick={() => this.delete()}
className="red0-bg white-font margin-r-m"
>
{this.props.msg.pkg.get("browser.delete")}
</button>
<button
type="button"
onClick={() => this.moveHere()}
className="margin-r-m"
>
{this.props.msg.pkg.get("browser.paste")}
</button>
</span>
) : null}
<div className="hr white0-bg margin-t-m"></div>
</div>
<Flexbox
children={List([
<span className="padding-m">