Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react';
import filesize from 'filesize';
import { useOvermind } from 'app/overmind';
import {
Container,
Title,
JustifiedArea,
SubTitle,
Description,
SubDescription,
Rule,
LoadingAnimationContainer,
} from './elements';
import FilesList from './FilesList';

const StorageManagementModal = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const StorageManagementModal = () => {
export const StorageManagementModal: React.FC = () => {

We'd like to move everything to named exports instead, so let's change this line.

const {
state: { uploadedFiles, usedStorage, maxStorage },
actions: {
files: { deletedUploadedFile, addedFileToSandbox },
},
} = useOvermind();

const isLoading = uploadedFiles === null;
const isEmpty = !isLoading && uploadedFiles.length === 0;

return (
<Container>
<JustifiedArea>
<Title>Storage Management</Title>
<SubTitle>
Used {filesize(usedStorage)}
{' / '}
Total {filesize(maxStorage)}
</SubTitle>
</JustifiedArea>
<Description>
This is where you can manage your uploaded files.
</Description>
<Rule />
{!isEmpty && !isLoading && (
<FilesList
files={uploadedFiles}
deleteFile={deletedUploadedFile}
deleteFiles={files => files.map(id => deletedUploadedFile({ id }))}
addFilesToSandbox={files => files.map(addedFileToSandbox)}
addFileToSandbox={addedFileToSandbox}
/>
)}
{isEmpty && <SubDescription>You have no uploaded files.</SubDescription>}
{isLoading && <LoadingAnimationContainer />}
</Container>
);
};

export default StorageManagementModal;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export default StorageManagementModal;

And we can remove this one.

Last thing I'd need you to do for me is to search the project for imports of StorageManagementModal and update those lines to used named imports instead. Should only be a single line for a modal like this.