-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from faisalsayed10/v1.2.0
- Loading branch information
Showing
73 changed files
with
4,280 additions
and
2,317 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ yarn-error.log* | |
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
.vercel |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Box, Flex, Grid, IconButton, Skeleton, Text } from "@chakra-ui/react"; | ||
import Folder from "@components/folders/Folder"; | ||
import { DriveFile, DriveFolder } from "@util/types"; | ||
import React from "react"; | ||
import { LayoutList } from "tabler-icons-react"; | ||
import File from "./files/File"; | ||
import AddFolderButton from "./folders/AddFolderButton"; | ||
|
||
type Props = { | ||
setGridView: React.Dispatch<React.SetStateAction<boolean>>; | ||
loading: boolean; | ||
currentFolder: DriveFolder; | ||
folders: DriveFolder[]; | ||
files: DriveFile[]; | ||
setIsFolderDeleting: React.Dispatch<React.SetStateAction<boolean>>; | ||
}; | ||
|
||
const GridView: React.FC<Props> = (props) => { | ||
return ( | ||
<Box mx="4" mb="6"> | ||
<Flex align="center" justify="space-between" my="4"> | ||
<Text fontSize="3xl" fontWeight="600"> | ||
Your Files | ||
</Text> | ||
<IconButton aria-label="change-view" onClick={() => props.setGridView(false)}> | ||
<LayoutList /> | ||
</IconButton> | ||
</Flex> | ||
{props.loading ? ( | ||
<Grid | ||
templateColumns={[ | ||
"repeat(auto-fill, minmax(140px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
]} | ||
gap={[2, 6, 6]} | ||
my="6" | ||
mx="4" | ||
> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
</Grid> | ||
) : ( | ||
<Grid | ||
templateColumns={[ | ||
"repeat(auto-fill, minmax(140px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
]} | ||
gap={[2, 6, 6]} | ||
> | ||
<AddFolderButton key="firefiles-add-folder-btn" currentFolder={props.currentFolder} /> | ||
{props.folders?.length > 0 && | ||
props.folders?.map((folder) => ( | ||
<Folder | ||
key={folder.name} | ||
setIsFolderDeleting={props.setIsFolderDeleting} | ||
folder={folder} | ||
/> | ||
))} | ||
{props.files?.length > 0 && | ||
props.files?.map((file) => <File key={file.name} file={file} gridView={true} />)} | ||
</Grid> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default GridView; |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { Divider, Flex, Grid, IconButton, Skeleton, Text } from "@chakra-ui/react"; | ||
import FilesEmptyState from "@components/files/FilesEmptyState"; | ||
import FilesTable from "@components/files/FilesTable"; | ||
import FilesTableSkeleton from "@components/files/FilesTableSkeleton"; | ||
import AddFolderButton from "@components/folders/AddFolderButton"; | ||
import Folder from "@components/folders/Folder"; | ||
import { DriveFile, DriveFolder } from "@util/types"; | ||
import React from "react"; | ||
import { LayoutGrid } from "tabler-icons-react"; | ||
|
||
type Props = { | ||
setGridView: React.Dispatch<React.SetStateAction<boolean>>; | ||
loading: boolean; | ||
currentFolder: DriveFolder; | ||
folders: DriveFolder[]; | ||
files: DriveFile[]; | ||
setIsFolderDeleting: React.Dispatch<React.SetStateAction<boolean>>; | ||
}; | ||
|
||
const ListView: React.FC<Props> = (props) => { | ||
return ( | ||
<> | ||
{props.loading ? ( | ||
<Grid | ||
templateColumns={[ | ||
"repeat(auto-fill, minmax(140px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
]} | ||
gap={[2, 6, 6]} | ||
my="6" | ||
mx="4" | ||
> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
<Skeleton h="140px" w="full" borderRadius="lg" /> | ||
</Grid> | ||
) : ( | ||
<Grid | ||
templateColumns={[ | ||
"repeat(auto-fill, minmax(140px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
"repeat(auto-fill, minmax(160px, 1fr))", | ||
]} | ||
gap={[2, 6, 6]} | ||
my="6" | ||
mx="4" | ||
> | ||
{props.folders?.map((f) => ( | ||
<Folder key={f.name} setIsFolderDeleting={props.setIsFolderDeleting} folder={f} /> | ||
))} | ||
<AddFolderButton currentFolder={props.currentFolder} /> | ||
</Grid> | ||
)} | ||
<Divider /> | ||
<Flex align="center" justify="space-between" m="4"> | ||
<Text fontSize="3xl" fontWeight="600"> | ||
Your Files | ||
</Text> | ||
<IconButton aria-label="change-view" onClick={() => props.setGridView(true)}> | ||
<LayoutGrid /> | ||
</IconButton> | ||
</Flex> | ||
{props.files === null && props.loading ? ( | ||
<FilesTableSkeleton /> | ||
) : !props.files || props.files?.length === 0 ? ( | ||
<FilesEmptyState /> | ||
) : ( | ||
<FilesTable files={props.files} /> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default ListView; |
Oops, something went wrong.
ff2b121
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
firefiles – ./
usefirefiles.vercel.app
firefiles-fayd.vercel.app
firefiles-git-main-fayd.vercel.app