fix(fe/panel_uploadings): refine uploading panel style

This commit is contained in:
hexxa 2021-12-21 20:35:06 +08:00 committed by Hexxa
parent c0fe1ffe55
commit 5d5527bb51
3 changed files with 42 additions and 10 deletions

View file

@ -167,7 +167,8 @@
margin-top: 2rem; margin-top: 2rem;
} }
.theme-default #item-rows .name, .theme-default #item-rows .name a { .theme-default #item-rows .name,
.theme-default #item-rows .name a {
color: #34495e; color: #34495e;
font-size: 1.8rem; font-size: 1.8rem;
line-height: 2rem; line-height: 2rem;
@ -229,8 +230,24 @@
padding: 0 1rem; padding: 0 1rem;
} }
.theme-default #upload-list .desc {
font-size: 1.2rem;
line-height: 2rem;
}
.theme-default #upload-list .progress-grey {
background-color: #ecf0f6;
width: 100%;
height: 0.3rem;
}
.theme-default #upload-list .progress-green {
background-color: #1abc9c;
height: 100%
}
.theme-default .upload-item { .theme-default .upload-item {
padding: 0 0 1rem 0; padding: 1rem 0 1rem 0;
} }
.theme-default .share-item { .theme-default .share-item {

View file

@ -480,7 +480,9 @@ export class FilesPanel extends React.Component<Props, State, {}> {
</div> </div>
); );
const detailColor = this.state.showDetail.has(item.name) ? "cyan0" : "grey0"; 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">

View file

@ -78,9 +78,11 @@ export class UploadingsPanel extends React.Component<Props, State, {}> {
(uploading: UploadEntry) => { (uploading: UploadEntry) => {
const pathParts = uploading.filePath.split("/"); const pathParts = uploading.filePath.split("/");
const fileName = pathParts[pathParts.length - 1]; const fileName = pathParts[pathParts.length - 1];
const progress = `${Math.floor(
(uploading.uploaded / uploading.size) * 100
)}%`;
return ( return (
<div key={uploading.filePath}> <div key={uploading.filePath} className="upload-item">
<Flexbox <Flexbox
children={List([ children={List([
<Flexbox <Flexbox
@ -91,12 +93,17 @@ export class UploadingsPanel extends React.Component<Props, State, {}> {
className="margin-r-m blue0-font" className="margin-r-m blue0-font"
/>, />,
<div className={`${nameWidthClass}`}> <div className={`font-s ${nameWidthClass}`}>
<span className="title-m">{fileName}</span> <span className="">{fileName}&nbsp;</span>
<div className="desc-m grey0-font"> <span className="desc grey0-font">
{FileSize(uploading.uploaded, { round: 0 })} {FileSize(uploading.uploaded, { round: 0 })}
&nbsp;/&nbsp;{FileSize(uploading.size, { round: 0 })} &nbsp;/&nbsp;
</div> {FileSize(uploading.size, {
round: 0,
})}
&nbsp;/&nbsp;
{progress}
</span>
</div>, </div>,
])} ])}
/>, />,
@ -118,6 +125,12 @@ export class UploadingsPanel extends React.Component<Props, State, {}> {
])} ])}
childrenStyles={List([{}, { justifyContent: "flex-end" }])} childrenStyles={List([{}, { justifyContent: "flex-end" }])}
/> />
<div className="progress-grey">
<div
className="progress-green"
style={{ width: `${progress}` }}
></div>
</div>
{uploading.err.trim() === "" ? null : ( {uploading.err.trim() === "" ? null : (
<div className="error">{uploading.err.trim()}</div> <div className="error">{uploading.err.trim()}</div>
)} )}