fix(fe/panel_files): small fixes

This commit is contained in:
hexxa 2021-12-21 20:12:24 +08:00 committed by Hexxa
parent 3550a3a77d
commit c0fe1ffe55

View file

@ -480,6 +480,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
</div> </div>
); );
const detailColor = this.state.showDetail.has(item.name) ? "cyan0" : "grey0";
const op = item.isDir ? ( const op = item.isDir ? (
<div className={`v-mid item-cell item-op ${showOp}`}> <div className={`v-mid item-cell item-op ${showOp}`}>
<span onClick={() => this.select(item.name)} className="float-l"> <span onClick={() => this.select(item.name)} className="float-l">
@ -494,7 +495,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
onClick={() => this.toggleDetail(item.name)} onClick={() => this.toggleDetail(item.name)}
className="float-l" className="float-l"
> >
{getIcon("RiInformationFill", "1.8rem", "black1")} {getIcon("RiInformationFill", "1.8rem", detailColor)}
</span> </span>
<span onClick={() => this.select(item.name)} className="float-l"> <span onClick={() => this.select(item.name)} className="float-l">
@ -781,6 +782,14 @@ export class FilesPanel extends React.Component<Props, State, {}> {
} }
); );
const rowsViewColorClass =
this.props.ui.control.controls.get(filesViewCtrl) === "rows"
? "cyan0-font"
: "black-font";
const tableViewColorClass =
this.props.ui.control.controls.get(filesViewCtrl) === "table"
? "cyan0-font"
: "black-font";
const itemListPane = ( const itemListPane = (
<div> <div>
<div className={showOp}> <div className={showOp}>
@ -836,15 +845,15 @@ export class FilesPanel extends React.Component<Props, State, {}> {
<Flexbox <Flexbox
children={List([ children={List([
<BiListUl <BiListUl
size="1.4rem" size="2rem"
className="black-font margin-r-s" className={`${rowsViewColorClass} margin-r-s`}
onClick={() => { onClick={() => {
this.setView("rows"); this.setView("rows");
}} }}
/>, />,
<BiTable <BiTable
size="1.4rem" size="2rem"
className="black-font margin-r-s" className={`${tableViewColorClass} margin-r-s`}
onClick={() => { onClick={() => {
this.setView("table"); this.setView("table");
}} }}