fix(fe/panel_files): hide elements in share mode
This commit is contained in:
parent
6dc8802752
commit
2f5c4b3ddb
1 changed files with 15 additions and 5 deletions
|
@ -29,7 +29,7 @@ import { Rows, Row } from "./layout/rows";
|
||||||
import { Up } from "../worker/upload_mgr";
|
import { Up } from "../worker/upload_mgr";
|
||||||
import { UploadEntry, UploadState } from "../worker/interface";
|
import { UploadEntry, UploadState } from "../worker/interface";
|
||||||
import { getIcon } from "./visual/icons";
|
import { getIcon } from "./visual/icons";
|
||||||
import { filesViewCtrl } from "../common/controls";
|
import { ctrlOn, sharingCtrl, filesViewCtrl } from "../common/controls";
|
||||||
|
|
||||||
export interface Item {
|
export interface Item {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -559,6 +559,11 @@ export class FilesPanel extends React.Component<Props, State, {}> {
|
||||||
sortedItems: List<MetadataResp>,
|
sortedItems: List<MetadataResp>,
|
||||||
showOp: string
|
showOp: string
|
||||||
): React.ReactNode => {
|
): React.ReactNode => {
|
||||||
|
const shareModeClass =
|
||||||
|
this.props.ui.control.controls.get(sharingCtrl) === ctrlOn
|
||||||
|
? "hidden"
|
||||||
|
: "";
|
||||||
|
|
||||||
const sortKeys = List<string>([
|
const sortKeys = List<string>([
|
||||||
this.props.msg.pkg.get("item.type"),
|
this.props.msg.pkg.get("item.type"),
|
||||||
this.props.msg.pkg.get("item.name"),
|
this.props.msg.pkg.get("item.name"),
|
||||||
|
@ -599,7 +604,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
|
||||||
<div className={`v-mid item-op ${showOp}`}>
|
<div className={`v-mid item-op ${showOp}`}>
|
||||||
<RiCheckboxFill
|
<RiCheckboxFill
|
||||||
size="1.8rem"
|
size="1.8rem"
|
||||||
className={selectedIconColor}
|
className={`${selectedIconColor} ${shareModeClass}`}
|
||||||
onClick={() => this.select(item.name)}
|
onClick={() => this.select(item.name)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -613,7 +618,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
|
||||||
|
|
||||||
<RiCheckboxFill
|
<RiCheckboxFill
|
||||||
size="1.8rem"
|
size="1.8rem"
|
||||||
className={selectedIconColor}
|
className={`${selectedIconColor} ${shareModeClass}`}
|
||||||
onClick={() => this.select(item.name)}
|
onClick={() => this.select(item.name)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -670,7 +675,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
|
||||||
<RiRefreshLine
|
<RiRefreshLine
|
||||||
onClick={() => this.generateHash(itemPath)}
|
onClick={() => this.generateHash(itemPath)}
|
||||||
size={"2rem"}
|
size={"2rem"}
|
||||||
className="black-font"
|
className={`black-font ${shareModeClass}`}
|
||||||
/>,
|
/>,
|
||||||
])}
|
])}
|
||||||
childrenStyles={List([{}, { justifyContent: "flex-end" }])}
|
childrenStyles={List([{}, { justifyContent: "flex-end" }])}
|
||||||
|
@ -731,6 +736,11 @@ export class FilesPanel extends React.Component<Props, State, {}> {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const shareModeClass =
|
||||||
|
this.props.ui.control.controls.get(sharingCtrl) === ctrlOn
|
||||||
|
? "hidden"
|
||||||
|
: "";
|
||||||
|
|
||||||
const showOp = this.props.login.userRole === roleVisitor ? "hidden" : "";
|
const showOp = this.props.login.userRole === roleVisitor ? "hidden" : "";
|
||||||
const breadcrumb = this.props.filesInfo.dirPath.map(
|
const breadcrumb = this.props.filesInfo.dirPath.map(
|
||||||
(pathPart: string, key: number) => {
|
(pathPart: string, key: number) => {
|
||||||
|
@ -920,7 +930,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
|
||||||
</div>,
|
</div>,
|
||||||
<div
|
<div
|
||||||
id="space-used"
|
id="space-used"
|
||||||
className="grey0-font"
|
className={`grey0-font ${shareModeClass}`}
|
||||||
>{`${this.props.msg.pkg.get(
|
>{`${this.props.msg.pkg.get(
|
||||||
"browser.used"
|
"browser.used"
|
||||||
)} ${usedSpace} / ${spaceLimit}`}</div>,
|
)} ${usedSpace} / ${spaceLimit}`}</div>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue