diff --git a/package.json b/package.json index a7d2edf..c4ae261 100644 --- a/package.json +++ b/package.json @@ -80,4 +80,4 @@ "url": "https://github.com/diced/zipline.git" }, "packageManager": "yarn@3.2.1" -} \ No newline at end of file +} diff --git a/src/components/File.tsx b/src/components/File.tsx index 0811908..e2bdf79 100644 --- a/src/components/File.tsx +++ b/src/components/File.tsx @@ -4,7 +4,7 @@ import { showNotification } from '@mantine/notifications'; import { relativeTime } from 'lib/utils/client'; import { useFileDelete, useFileFavorite } from 'lib/queries/files'; import { useState } from 'react'; -import { CalendarIcon, ClockIcon, CopyIcon, CrossIcon, DeleteIcon, ExternalLinkIcon, FileIcon, HashIcon, ImageIcon, StarIcon } from './icons'; +import { CalendarIcon, ClockIcon, CopyIcon, CrossIcon, DeleteIcon, ExternalLinkIcon, FileIcon, HashIcon, ImageIcon, StarIcon, EyeIcon } from './icons'; import MutedText from './MutedText'; import Type from './Type'; import Link from './Link'; @@ -96,6 +96,7 @@ export default function File({ image, updateImages, disableMediaPreview }) { }); }; + console.log(image); return ( <> + {image.expires_at && - Drag images here or click to select files + Drag files here or click to select files diff --git a/src/components/icons/EyeIcon.tsx b/src/components/icons/EyeIcon.tsx new file mode 100644 index 0000000..0a50ad6 --- /dev/null +++ b/src/components/icons/EyeIcon.tsx @@ -0,0 +1,5 @@ +import { Eye } from 'react-feather'; + +export default function EyeIcon({ ...props }) { + return ; +} \ No newline at end of file diff --git a/src/components/icons/index.tsx b/src/components/icons/index.tsx index e95e1c2..99c288e 100644 --- a/src/components/icons/index.tsx +++ b/src/components/icons/index.tsx @@ -29,6 +29,7 @@ import DownloadIcon from './DownloadIcon'; import FlameshotIcon from './FlameshotIcon'; import GitHubIcon from './GitHubIcon'; import DiscordIcon from './DiscordIcon'; +import EyeIcon from './EyeIcon'; export { ActivityIcon, @@ -62,4 +63,5 @@ export { FlameshotIcon, GitHubIcon, DiscordIcon, + EyeIcon, }; \ No newline at end of file diff --git a/src/components/pages/Manage/index.tsx b/src/components/pages/Manage/index.tsx index efad863..6bb3d3c 100644 --- a/src/components/pages/Manage/index.tsx +++ b/src/components/pages/Manage/index.tsx @@ -202,7 +202,7 @@ export default function Manage() { }; const openDeleteModal = () => modals.openConfirmModal({ - title: 'Are you sure you want to delete all of your images?', + title: 'Are you sure you want to delete all of your files?', closeOnConfirm: false, labels: { confirm: 'Yes', cancel: 'No' }, onConfirm: () => { diff --git a/src/components/pages/Upload.tsx b/src/components/pages/Upload.tsx index eea4da2..623953f 100644 --- a/src/components/pages/Upload.tsx +++ b/src/components/pages/Upload.tsx @@ -101,7 +101,7 @@ export default function Upload() { showNotification({ id: 'upload', - title: 'Uploading Images...', + title: 'Uploading files...', message: '', loading: true, autoClose: false, @@ -123,7 +123,7 @@ export default function Upload() { updateNotification({ id: 'upload', title: 'Upload Successful', - message: <>Copied first image to clipboard!
{json.files.map(x => ({x}
))}, + message: <>Copied first file to clipboard!
{json.files.map(x => ({x}
))}, color: 'green', icon: , }); diff --git a/src/pages/api/user/files.ts b/src/pages/api/user/files.ts index 19693b0..2cb45fb 100644 --- a/src/pages/api/user/files.ts +++ b/src/pages/api/user/files.ts @@ -25,7 +25,7 @@ async function handler(req: NextApiReq, res: NextApiRes) { userId: user.id, }, }); - Logger.get('image').info(`User ${user.username} (${user.id}) deleted ${count} images.`); + Logger.get('image').info(`User ${user.username} (${user.id}) deleted ${count} files.`); return res.json({ count }); } else { @@ -74,14 +74,15 @@ async function handler(req: NextApiReq, res: NextApiRes) { mimetype: true, id: true, favorite: true, + views: true, }, }); - + // @ts-ignore images.map(image => image.url = `/r/${image.file}`); if (req.query.filter && req.query.filter === 'media') images = images.filter(x => /^(video|audio|image|text)/.test(x.mimetype)); - + return res.json(req.query.paged ? chunk(images, 16) : images); } } diff --git a/src/pages/api/users.ts b/src/pages/api/users.ts index 22b300a..2ca4c9b 100644 --- a/src/pages/api/users.ts +++ b/src/pages/api/users.ts @@ -49,7 +49,7 @@ async function handler(req: NextApiReq, res: NextApiRes) { userId: deleteUser.id, }, }); - Logger.get('image').info(`User ${user.username} (${user.id}) deleted ${count} images of user ${deleteUser.username} (${deleteUser.id})`); + Logger.get('image').info(`User ${user.username} (${user.id}) deleted ${count} files of user ${deleteUser.username} (${deleteUser.id})`); } await prisma.user.delete({