Skip to content

Commit 45635b3

Browse files
committed
🎨 (prettier) create prettier and format code
1 parent d2970c4 commit 45635b3

33 files changed

+217
-154
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
open_collective: faisalsayed10
44
ko_fi: faisalsayed10
55
liberapay: faisalsayed10
6-
custom: ['https://www.buymeacoffee.com/faisalsayed10']
6+
custom: ["https://www.buymeacoffee.com/faisalsayed10"]

.prettierignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
.wakatime-*
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env.local
30+
.env.development.local
31+
.env.test.local
32+
.env.production.local
33+
34+
# vercel
35+
.vercel

.prettierrc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"useTabs": true,
5+
"semi": true,
6+
"singleQuote": false,
7+
"printWidth": 100
8+
}

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
Get your own file hosting service in minutes. This is the hosted version of Firefiles, Make sure you check the [docs](https://firefiles.vercel.app/docs) before getting started.
99

10-
1110
# Features
1211

1312
Get a Google Drive like interface for your storage buckets!
@@ -24,8 +23,7 @@ Get a Google Drive like interface for your storage buckets!
2423

2524
# Tech Used
2625

27-
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E) ![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) ![Vercel](https://img.shields.io/badge/vercel-%23000000.svg?style=for-the-badge&logo=vercel&logoColor=white) ![Firebase](https://img.shields.io/badge/firebase-%23039BE5.svg?style=for-the-badge&logo=firebase) ![Next JS](https://img.shields.io/badge/Next-black?style=for-the-badge&logo=next.js&logoColor=white) ![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
28-
26+
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E) ![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) ![Vercel](https://img.shields.io/badge/vercel-%23000000.svg?style=for-the-badge&logo=vercel&logoColor=white) ![Firebase](https://img.shields.io/badge/firebase-%23039BE5.svg?style=for-the-badge&logo=firebase) ![Next JS](https://img.shields.io/badge/Next-black?style=for-the-badge&logo=next.js&logoColor=white) ![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
2927

3028
<!-- </> with 💛 by readMD (https://readmd.itsvg.in) -->
3129

components/Dashboard.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import UploadProgress from "./files/UploadProgress";
1616

1717
const baseStyle = {
1818
outline: "none",
19-
transition: "border .2s ease-in-out"
19+
transition: "border .2s ease-in-out",
2020
};
2121

2222
const activeStyle = {
2323
borderWidth: 2,
2424
borderRadius: 2,
2525
borderStyle: "dashed",
2626
borderColor: "#2196f3",
27-
backgroundColor: "rgba(0, 0, 0, 0.25)"
27+
backgroundColor: "rgba(0, 0, 0, 0.25)",
2828
};
2929

3030
const Dashboard = () => {

components/files/File.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Text,
99
Tr,
1010
useClipboard,
11-
useDisclosure
11+
useDisclosure,
1212
} from "@chakra-ui/react";
1313
import { faCopy, faDownload, faTrash } from "@fortawesome/free-solid-svg-icons";
1414
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -134,11 +134,11 @@ const File: React.FC<Props> = ({ file }) => {
134134
_focus={{ outline: "none", border: "none" }}
135135
backgroundColor="gray.700"
136136
/>
137-
<FilePreview
138-
mimetype={data?.contentType}
139-
url={`${file_url}?alt=media&token=${data?.downloadTokens}`}
140-
file={file}
141-
/>
137+
<FilePreview
138+
mimetype={data?.contentType}
139+
url={`${file_url}?alt=media&token=${data?.downloadTokens}`}
140+
file={file}
141+
/>
142142
</ModalContent>
143143
</Modal>
144144
</>

components/files/FilePreview.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Th,
1313
Thead,
1414
Tr,
15-
useColorMode
15+
useColorMode,
1616
} from "@chakra-ui/react";
1717
import { faDownload, faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons";
1818
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -61,7 +61,7 @@ const FilePreview: React.FC<Props> = ({ mimetype, url, file }) => {
6161
fontSize: 13,
6262
backgroundColor: colorMode === "light" ? "#FFFFFF" : "#2D3748",
6363
overflowY: "auto",
64-
fontFamily: "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace"
64+
fontFamily: "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",
6565
}),
6666
[colorMode]
6767
);

components/files/FilesEmptyState.tsx

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ import { Flex, Text } from "@chakra-ui/react";
22
import React from "react";
33

44
const FilesEmptyState = () => (
5-
<Flex
6-
p={["8", "16", "16"]}
7-
mx="4"
8-
borderWidth="1px"
9-
borderRadius="lg"
10-
justify="center"
11-
direction="column"
12-
align="center"
13-
textAlign="center"
14-
>
15-
<Text fontSize={["lg", "xl", "2xl"]} fontWeight="400" mb={8}>
16-
There aren't any files
17-
</Text>
18-
<Text fontSize={["sm", "sm", "md"]} fontWeight="400">
19-
Drop a file anywhere on the screen or click the button on the bottom right to upload a file.
20-
</Text>
21-
</Flex>
5+
<Flex
6+
p={["8", "16", "16"]}
7+
mx="4"
8+
borderWidth="1px"
9+
borderRadius="lg"
10+
justify="center"
11+
direction="column"
12+
align="center"
13+
textAlign="center"
14+
>
15+
<Text fontSize={["lg", "xl", "2xl"]} fontWeight="400" mb={8}>
16+
There aren't any files
17+
</Text>
18+
<Text fontSize={["sm", "sm", "md"]} fontWeight="400">
19+
Drop a file anywhere on the screen or click the button on the bottom right to upload a file.
20+
</Text>
21+
</Flex>
2222
);
2323

2424
export default FilesEmptyState;

components/files/FilesTableSkeleton.tsx

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import { Box, Skeleton, Table, Td, Th, Tr } from "@chakra-ui/react";
22
import React from "react";
33

44
interface Props {
5-
width?: string;
5+
width?: string;
66
}
77

88
const SkeletonRow: React.FC<Props> = ({ width }) => (
9-
<Box as="tr">
10-
<Td>
11-
<Skeleton height="5px" width={width} my={3} />
12-
</Td>
13-
<Td>
14-
<Skeleton height="5px" width={width} my={3} />
15-
</Td>
16-
<Td>
17-
<Skeleton height="5px" width={width} my={3} />
18-
</Td>
19-
<Td>
20-
<Skeleton height="5px" width={width} my={3} />
21-
</Td>
22-
<Td>
23-
<Skeleton height="5px" width={width} my={3} />
24-
</Td>
25-
</Box>
9+
<Box as="tr">
10+
<Td>
11+
<Skeleton height="5px" width={width} my={3} />
12+
</Td>
13+
<Td>
14+
<Skeleton height="5px" width={width} my={3} />
15+
</Td>
16+
<Td>
17+
<Skeleton height="5px" width={width} my={3} />
18+
</Td>
19+
<Td>
20+
<Skeleton height="5px" width={width} my={3} />
21+
</Td>
22+
<Td>
23+
<Skeleton height="5px" width={width} my={3} />
24+
</Td>
25+
</Box>
2626
);
2727

2828
const FilesTableSkeleton = () => {
29-
return (
29+
return (
3030
<Box borderWidth="1px" borderRadius="lg" overflowX="auto" mx="4">
3131
<Table>
3232
<thead>

components/files/UploadFileButton.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const UploadFileButton: React.FC<Props> = ({
2222
filesToUpload,
2323
setFilesToUpload,
2424
uploadingFiles,
25-
setUploadingFiles
25+
setUploadingFiles,
2626
}) => {
2727
const { app, appUser, addFile } = useFirebase();
2828
const fileInput = useRef<HTMLInputElement>();
@@ -56,7 +56,14 @@ const UploadFileButton: React.FC<Props> = ({
5656

5757
setUploadingFiles((prev) =>
5858
prev.concat([
59-
{ id, name: files[i].name, task: uploadTask, state: "running", progress: 0, error: false }
59+
{
60+
id,
61+
name: files[i].name,
62+
task: uploadTask,
63+
state: "running",
64+
progress: 0,
65+
error: false,
66+
},
6067
])
6168
);
6269

@@ -69,7 +76,7 @@ const UploadFileButton: React.FC<Props> = ({
6976
return {
7077
...uploadFile,
7178
state: snapshot.state,
72-
progress: Math.round((snapshot.bytesTransferred / snapshot.totalBytes) * 100)
79+
progress: Math.round((snapshot.bytesTransferred / snapshot.totalBytes) * 100),
7380
};
7481
}
7582

components/folders/AddFolderButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ModalHeader,
1212
ModalOverlay,
1313
useColorModeValue,
14-
useDisclosure
14+
useDisclosure,
1515
} from "@chakra-ui/react";
1616
import { StorageReference } from "@firebase/storage";
1717
import { faPlus } from "@fortawesome/free-solid-svg-icons";
@@ -57,7 +57,7 @@ const AddFolderButton: React.FC<Props> = ({ currentFolder }) => {
5757
root: null,
5858
bucket: null,
5959
storage: null,
60-
parent: null
60+
parent: null,
6161
};
6262

6363
addFolder(newFolder);

components/folders/Folder.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
faExternalLinkAlt,
55
faFolderOpen,
66
faPlus,
7-
faTrash
7+
faTrash,
88
} from "@fortawesome/free-solid-svg-icons";
99
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
1010
import useFirebase from "@hooks/useFirebase";

components/popups/DeleteAlert.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
AlertDialogFooter,
66
AlertDialogHeader,
77
AlertDialogOverlay,
8-
Button
8+
Button,
99
} from "@chakra-ui/react";
1010
import React from "react";
1111

components/popups/FirebaseInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
FormControl,
1111
Link,
1212
Text,
13-
Textarea
13+
Textarea,
1414
} from "@chakra-ui/react";
1515
import { LoadingSpinner, Player } from "video-react";
1616

components/ui/AddBucketButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ModalFooter,
1010
ModalHeader,
1111
ModalOverlay,
12-
useDisclosure
12+
useDisclosure,
1313
} from "@chakra-ui/react";
1414
import { faArrowLeft, faPlus } from "@fortawesome/free-solid-svg-icons";
1515
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -68,7 +68,7 @@ const AddBucketButton = () => {
6868
toast.promise(promise, {
6969
loading: "Creating bucket...",
7070
success: "Bucket created successfully.",
71-
error: "An error occurred while creating the bucket."
71+
error: "An error occurred while creating the bucket.",
7272
});
7373

7474
promise.then(() => {

components/ui/Navbar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
MenuItem,
99
MenuList,
1010
Tooltip,
11-
useColorMode
11+
useColorMode,
1212
} from "@chakra-ui/react";
1313
import {
1414
faArrowCircleLeft,
@@ -17,7 +17,7 @@ import {
1717
faFile,
1818
faMoon,
1919
faSignOutAlt,
20-
faSun
20+
faSun,
2121
} from "@fortawesome/free-solid-svg-icons";
2222
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
2323
import useUser from "@hooks/useUser";

hooks/useFirebase.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
getAuth,
88
onAuthStateChanged,
99
signInWithEmailAndPassword,
10-
User
10+
User,
1111
} from "firebase/auth";
1212
import { getStorage, list, ref, StorageReference } from "firebase/storage";
1313
import { nanoid } from "nanoid";
@@ -36,7 +36,7 @@ export const ROOT_FOLDER: StorageReference = {
3636
parent: null,
3737
root: null,
3838
bucket: null,
39-
storage: null
39+
storage: null,
4040
};
4141

4242
export default () => useContext(FirebaseContext);
@@ -165,13 +165,13 @@ export const FirebaseProvider: React.FC<Props> = ({ data, fullPath, children })
165165
while (results.nextPageToken) {
166166
const more = await list(reference, {
167167
maxResults: 100,
168-
pageToken: results.nextPageToken
168+
pageToken: results.nextPageToken,
169169
});
170170

171171
results = {
172172
nextPageToken: more.nextPageToken,
173173
items: [...results.items, ...more.items],
174-
prefixes: [...results.prefixes, ...more.prefixes]
174+
prefixes: [...results.prefixes, ...more.prefixes],
175175
};
176176

177177
setFiles(results.items);
@@ -210,7 +210,7 @@ export const FirebaseProvider: React.FC<Props> = ({ data, fullPath, children })
210210
addFile,
211211
addFolder,
212212
removeFile,
213-
removeFolder
213+
removeFolder,
214214
}}
215215
>
216216
{children}

hooks/useUser.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
sendPasswordResetEmail,
77
signInWithEmailAndPassword,
88
signOut,
9-
User
9+
User,
1010
} from "firebase/auth";
1111
import { createContext, useContext, useEffect, useState } from "react";
1212
import toast from "react-hot-toast";

0 commit comments

Comments
 (0)