copy: fixes awkward copy on file uploads

This commit is contained in:
@wwwjim 2020-09-09 01:41:25 -07:00
parent 91a2635446
commit 23f7be9b54
3 changed files with 32 additions and 16 deletions

View File

@ -36,7 +36,7 @@ const STYLES_ROW = css`
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
font-family: ${Constants.font.text}; font-family: ${Constants.font.code};
color: ${Constants.system.darkGray}; color: ${Constants.system.darkGray};
font-size: 10px; font-size: 10px;
margin-top: 2px; margin-top: 2px;
@ -75,11 +75,6 @@ export const DataMeterBar = (props) => {
return ( return (
<React.Fragment> <React.Fragment>
<div css={STYLES_TITLE}>
{Strings.bytesToSize(props.bytes)} of available{" "}
{Strings.bytesToSize(props.maximumBytes)} Used
</div>
<div css={STYLES_ROW}> <div css={STYLES_ROW}>
<div <div
css={STYLES_LEFT} css={STYLES_LEFT}
@ -93,7 +88,7 @@ export const DataMeterBar = (props) => {
<div <div
css={STYLES_DATA} css={STYLES_DATA}
style={{ style={{
marginTop: 16, marginTop: 8,
backgroundColor: props.failed ? Constants.system.red : null, backgroundColor: props.failed ? Constants.system.red : null,
}} }}
> >
@ -109,6 +104,11 @@ export const DataMeterBar = (props) => {
export const DataMeter = (props) => { export const DataMeter = (props) => {
return ( return (
<div css={STYLES_CONTAINER} style={props.style}> <div css={STYLES_CONTAINER} style={props.style}>
<div css={STYLES_TITLE}>
{Strings.bytesToSize(props.stats.bytes)} of{" "}
{Strings.bytesToSize(props.stats.maximumBytes)} used
</div>
<DataMeterBar <DataMeterBar
bytes={props.stats.bytes} bytes={props.stats.bytes}
maximumBytes={props.stats.maximumBytes} maximumBytes={props.stats.maximumBytes}

View File

@ -115,7 +115,7 @@ const SlateItem = (props) => {
</div> </div>
<div css={STYLES_DESCRIPTION}> <div css={STYLES_DESCRIPTION}>
{props.slate.data.objects.length}{" "} {Strings.zeroPad(props.slate.data.objects.length, 4)}{" "}
{Strings.pluralize("object", props.slate.data.objects.length)}{" "} {Strings.pluralize("object", props.slate.data.objects.length)}{" "}
{!props.member ? ( {!props.member ? (
<span <span

View File

@ -1,5 +1,6 @@
import * as React from "react"; import * as React from "react";
import * as Constants from "~/common/constants"; import * as Constants from "~/common/constants";
import * as Strings from "~/common/strings";
import * as System from "~/components/system"; import * as System from "~/components/system";
import * as Validations from "~/common/validations"; import * as Validations from "~/common/validations";
@ -50,6 +51,14 @@ const STYLES_STRONG = css`
font-weight: 400; font-weight: 400;
font-family: ${Constants.font.medium}; font-family: ${Constants.font.medium};
font-size: 0.8rem; font-size: 0.8rem;
oveflow-wrap: break-word;
`;
const STYLES_PERFORMANCE = css`
font-family: ${Constants.font.code};
font-size: 12px;
display: block;
margin: 0 0 8px 0;
`; `;
export default class SidebarAddFileToBucket extends React.Component { export default class SidebarAddFileToBucket extends React.Component {
@ -144,14 +153,16 @@ export default class SidebarAddFileToBucket extends React.Component {
</System.P> </System.P>
) : null} ) : null}
<System.ButtonPrimary {!this.props.fileLoading ? (
full <System.ButtonPrimary
type="label" full
htmlFor="file" type="label"
style={{ marginTop: 24 }} htmlFor="file"
loading={!!this.props.fileLoading}> style={{ marginTop: 24 }}
Add file >
</System.ButtonPrimary> Add file
</System.ButtonPrimary>
) : null}
<br /> <br />
@ -161,6 +172,11 @@ export default class SidebarAddFileToBucket extends React.Component {
return ( return (
<React.Fragment key={timestamp}> <React.Fragment key={timestamp}>
<strong css={STYLES_STRONG}>{p.name}</strong> <strong css={STYLES_STRONG}>{p.name}</strong>
<strong css={STYLES_PERFORMANCE}>
{Strings.bytesToSize(p.loaded)} /{" "}
{Strings.bytesToSize(p.total)}
</strong>
<DataMeterBar <DataMeterBar
failed={p.failed} failed={p.failed}
leftLabel={p.failed ? "failed" : "uploaded"} leftLabel={p.failed ? "failed" : "uploaded"}