diff --git a/components/core/DataMeterDetailed.js b/components/core/DataMeterDetailed.js index 5a5f2634..374ac158 100644 --- a/components/core/DataMeterDetailed.js +++ b/components/core/DataMeterDetailed.js @@ -32,7 +32,6 @@ const STYLES_DATA_METER_BASE = css` width: 100%; display: flex; align-items: center; - height: 16px; border-radius: 3px; background-color: ${Constants.system.foreground}; overflow: hidden; @@ -41,7 +40,6 @@ const STYLES_DATA_METER_BASE = css` const STYLES_DATA_METER = css` flex-shrink: 0; position: absolute; - height: 16px; top: 0px; left: 0px; border-radius: 3px 0px 0px 3px; @@ -50,31 +48,17 @@ const STYLES_DATA_METER = css` const STYLES_ROW = css` font-family: ${Constants.font.code}; color: ${Constants.system.darkGray}; + background-color: ${Constants.system.foreground}; display: inline-flex; height: 16px; - border-radius: 3px 0px 0px 3px; width: 100%; `; const STYLES_STATS_ROW = css` - font-family: ${Constants.font.text}; - color: ${Constants.system.black}; - text-transform: uppercase; - display: inline-flex; background-color: ${Constants.system.foreground}; - margin: 48px; width: 100%; - height: 48px; -`; - -const STYLES_LEFT = css` - min-width: 10%; - width: 100%; - border-radius: 15px 50px 30px 5px; -`; - -const STYLES_RIGHT = css` - flex-shrink: 0; + border-radius: 3px; + height: 16px; `; const STYLES_TITLE = css` @@ -114,54 +98,58 @@ const STYLES_DATA_METER_KEY_LABEL = css` const DATA_METER_METER_SEGMENT = css` height: 16px; - border-radius: 3px 0px 0px 3px; `; export const DataMeterBar = (props) => { - const totalSize = props.maximumBytes; - const percentage = props.bytes / props.maximumBytes; - const percentageImage = props.stats.imageBytes / props.maximumBytes; - const percentageVideo = props.stats.videoBytes; - const percentageEpub = props.stats.epubBytes; - const percentagePdf = props.stats.pdfBytes; - const percentageAudio = props.stats.audioBytes; - const percentageFreeSpace = - props.maximumBytes - - (props.stats.imageBytes + - props.stats.videoBytes + - props.stats.epubBytes + - props.stats.epubBytes + - props.stats.pdfBytes + - props.stats.audioBytes); + const percentageUsed = props.bytes / props.maximumBytes; + const percentageImage = props.stats.imageBytes / props.bytes; + const percentageVideo = props.stats.videoBytes / props.bytes; + const percentageEpub = props.stats.epubBytes / props.bytes; + const percentagePdf = props.stats.pdfBytes / props.bytes; + const percentageAudio = props.stats.audioBytes / props.bytes; + const percentageFreeSpace = props.bytes - props.maximumBytes; console.log(percentageImage); return ( -
+
-
-
-
-
+ css={STYLES_ROW} + style={{ + width: `${percentageUsed * 100}%`, + }} + > +
+
+
+
+
+
+
);