-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Went back to regular SCSS to gain an output SCSS for when Service Wor…
…kers are loaded
- Loading branch information
Showing
43 changed files
with
698 additions
and
1,383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { formatBytes } from '../utils'; | ||
|
||
const Count = ({ data }) => { | ||
const Count = ({ data, deletedSize }) => { | ||
const amount = data.length; | ||
const fileSize = data.reduce((count, file) => { | ||
return count + file.size; | ||
}, 0); | ||
return ( | ||
<div> | ||
<p>You got {amount} files</p> | ||
<p>{formatBytes(fileSize)}</p> | ||
<div className="Count"> | ||
<p className="Count__Text"> | ||
There are <span className="purple">{amount} files</span> you can delete | ||
</p> | ||
<p className="Count__Text"> | ||
It could save you <span className="red">{formatBytes(fileSize)}</span> | ||
</p> | ||
{deletedSize > 0 && ( | ||
<p className="Count__Text"> | ||
Nice! You just saved{' '} | ||
<span className="blue">{formatBytes(deletedSize)}</span> | ||
</p> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
Count.propTypes = { | ||
data: PropTypes.array, | ||
deletedSize: PropTypes.number, | ||
}; | ||
|
||
export default Count; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.