-
+
+
+
+
+
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 3795919..9e4f4eb 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -20,6 +20,7 @@ import {
faArrowAltCircleDown,
faTrashAlt,
faEnvelope,
+ faFlag,
faCheckCircle,
} from '@fortawesome/free-regular-svg-icons'
import {
@@ -28,6 +29,7 @@ import {
faPlus,
faMinus,
faCopy as faCopySolid,
+ faAngleRight,
faDownload,
faMusic,
faArrowLeft,
@@ -39,10 +41,14 @@ import {
faSignOutAlt,
faCloud,
faChevronCircleDown,
+ faChevronDown,
faLink,
faExternalLinkAlt,
faExclamationCircle,
faExclamationTriangle,
+ faTh,
+ faThLarge,
+ faThList,
faHome,
} from '@fortawesome/free-solid-svg-icons'
import * as Icons from '@fortawesome/free-brands-svg-icons'
@@ -67,10 +73,12 @@ library.add(
faFileCode,
faFileAlt,
faFile,
+ faFlag,
faFolder,
faMusic,
faArrowLeft,
faArrowRight,
+ faAngleRight,
faFileDownload,
faCopy,
faCopySolid,
@@ -94,6 +102,10 @@ library.add(
faCheck,
faCheckCircle,
faSearch,
+ faChevronDown,
+ faTh,
+ faThLarge,
+ faThList,
...iconList
)
diff --git a/pages/api/index.ts b/pages/api/index.ts
index 5addae6..e4fb79b 100644
--- a/pages/api/index.ts
+++ b/pages/api/index.ts
@@ -220,11 +220,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
params: next
? {
select: '@microsoft.graph.downloadUrl,name,size,id,lastModifiedDateTime,folder,file,video,image',
+ $expand: 'thumbnails',
top: siteConfig.maxItems,
$skipToken: next,
}
: {
select: '@microsoft.graph.downloadUrl,name,size,id,lastModifiedDateTime,folder,file,video,image',
+ $expand: 'thumbnails',
top: siteConfig.maxItems,
},
})
diff --git a/pages/index.tsx b/pages/index.tsx
index 47efa71..23789d8 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -5,18 +5,22 @@ import Navbar from '../components/Navbar'
import FileListing from '../components/FileListing'
import Footer from '../components/Footer'
import Breadcrumb from '../components/Breadcrumb'
+import { SwitchLayout } from '../components/SwitchLayout'
export default function Home() {
return (
-
+
{siteConfig.title}
-
+
-
-
+
+
+
+
+
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 499dda2..bcdb121 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -7,6 +7,7 @@ specifiers:
'@fortawesome/free-solid-svg-icons': ^5.15.3
'@fortawesome/react-fontawesome': ^0.1.14
'@headlessui/react': ^1.4.0
+ '@tailwindcss/line-clamp': ^0.3.1
'@types/cors': ^2.8.12
'@types/crypto-js': ^4.0.2
'@types/ioredis': ^4.28.5
@@ -62,6 +63,7 @@ dependencies:
'@fortawesome/free-solid-svg-icons': 5.15.4
'@fortawesome/react-fontawesome': 0.1.17_f515edce028694561ceb456e3dba224c
'@headlessui/react': 1.4.3_react-dom@17.0.2+react@17.0.2
+ '@tailwindcss/line-clamp': 0.3.1_tailwindcss@3.0.18
awesome-debounce-promise: 2.1.0
axios: 0.25.0
cors: 2.8.5
@@ -376,6 +378,14 @@ packages:
resolution: {integrity: sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A==}
dev: true
+ /@tailwindcss/line-clamp/0.3.1_tailwindcss@3.0.18:
+ resolution: {integrity: sha512-pNr0T8LAc3TUx/gxCfQZRe9NB2dPEo/cedPHzUGIPxqDMhgjwNm6jYxww4W5l0zAsAddxr+XfZcqttGiFDgrGg==}
+ peerDependencies:
+ tailwindcss: '>=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1'
+ dependencies:
+ tailwindcss: 3.0.18_833e1018ad0d7954aa80c53675939269
+ dev: false
+
/@types/cors/2.8.12:
resolution: {integrity: sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==}
dev: true
diff --git a/tailwind.config.js b/tailwind.config.js
index e2adf33..2c01c61 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -35,5 +35,7 @@ module.exports = {
}
}
},
- plugins: [],
+ plugins: [
+ require('@tailwindcss/line-clamp'),
+ ],
}
diff --git a/types/index.d.ts b/types/index.d.ts
index 1872f2f..817be66 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -13,12 +13,15 @@ export type OdFolderObject = {
name: string
size: number
lastModifiedDateTime: string
- file?: { mimeType: string; hashes: { quickXorHash: string; sha1Hash?: string; sha256Hash?: string } }
+ file?: { mimeType: string; hashes: { quickXorHash?: string; sha1Hash?: string; sha256Hash?: string } }
folder?: { childCount: number; view: { sortBy: string; sortOrder: 'ascending'; viewType: 'thumbnails' } }
image?: OdImageFile
video?: OdVideoFile
+ 'thumbnails@odata.context'?: string
+ thumbnails?: Array
}>
}
+export type OdFolderChildren = OdFolderObject['value'][number]
// A file object returned from the OneDrive API. This object may contain 'video' if the file is a video.
export type OdFileObject = {
'@microsoft.graph.downloadUrl': string
diff --git a/utils/getFileIcon.ts b/utils/getFileIcon.ts
index 0f063ba..b2e230d 100644
--- a/utils/getFileIcon.ts
+++ b/utils/getFileIcon.ts
@@ -69,6 +69,11 @@ const extensions = {
txt: icons.text,
rtf: icons.text,
+ vtt: icons.text,
+ srt: icons.text,
+ log: icons.text,
+ diff: icons.text,
+
md: icons.markdown,
epub: icons.book,
diff --git a/utils/getPreviewType.ts b/utils/getPreviewType.ts
index b8d6a31..a6c5d3b 100644
--- a/utils/getPreviewType.ts
+++ b/utils/getPreviewType.ts
@@ -51,6 +51,10 @@ export const extensions = {
toml: preview.code,
txt: preview.text,
+ vtt: preview.text,
+ srt: preview.text,
+ log: preview.text,
+ diff: preview.text,
mp4: preview.video,
flv: preview.video,