diff --git a/components/LinkPreview.tsx b/components/LinkPreview.tsx deleted file mode 100644 index 891a69f7..00000000 --- a/components/LinkPreview.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { faFolder, faLink } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import Image from "next/image"; -import { faCalendarDays } from "@fortawesome/free-regular-svg-icons"; -import isValidUrl from "@/lib/shared/isValidUrl"; -import A from "next/link"; -import unescapeString from "@/lib/client/unescapeString"; -import { Link } from "@prisma/client"; - -type Props = { - link?: Partial; - className?: string; - settings: { - blurredFavicons: boolean; - displayLinkIcons: boolean; - }; -}; - -export default function LinkPreview({ link, className, settings }: Props) { - if (!link) { - link = { - name: "Linkwarden", - url: "https://linkwarden.app", - createdAt: Date.now() as unknown as Date, - }; - } - - let shortendURL; - - try { - shortendURL = new URL(link.url as string).host.toLowerCase(); - } catch (error) { - console.log(error); - } - - const url = isValidUrl(link.url as string) - ? new URL(link.url as string) - : undefined; - - const formattedDate = new Date(link.createdAt as Date).toLocaleString( - "en-US", - { - year: "numeric", - month: "short", - day: "numeric", - } - ); - - return ( - <> -
{1}
-- {unescapeString(link.name as string)} -
-Landing Pages ⚡️
-{shortendURL}
- -{formattedDate}
-Edit
-Preserved Formats
-Delete
-Color
{collectionOwner.name}
-@{collectionOwner.username}
{collectionOwner.name}
Screenshot
@@ -108,10 +101,6 @@ export default function PreservedFormats() { onClick={() => handleDownload(ArchivedFormat.png)} className="cursor-pointer hover:opacity-60 duration-100 p-2 rounded-md" > -View Latest Snapshot on archive.org
diff --git a/components/ModalContent/NewCollectionModal.tsx b/components/ModalContent/NewCollectionModal.tsx index de0fc98c..23b43444 100644 --- a/components/ModalContent/NewCollectionModal.tsx +++ b/components/ModalContent/NewCollectionModal.tsx @@ -1,11 +1,9 @@ import React, { useEffect, useState } from "react"; import TextInput from "@/components/TextInput"; import useCollectionStore from "@/store/collections"; -import toast, { Toaster } from "react-hot-toast"; -import { faFolder } from "@fortawesome/free-solid-svg-icons"; +import toast from "react-hot-toast"; import { HexColorPicker } from "react-colorful"; import { Collection } from "@prisma/client"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Modal from "../Modal"; type Props = { @@ -76,10 +74,6 @@ export default function NewCollectionModal({ onClose }: Props) {{label}
); diff --git a/layouts/LinkLayout.tsx b/layouts/LinkLayout.tsx deleted file mode 100644 index ddcced19..00000000 --- a/layouts/LinkLayout.tsx +++ /dev/null @@ -1,216 +0,0 @@ -import LinkSidebar from "@/components/LinkSidebar"; -import { ReactNode, useEffect, useState } from "react"; -import ModalManagement from "@/components/ModalManagement"; -import useModalStore from "@/store/modals"; -import { useRouter } from "next/router"; -import ClickAwayHandler from "@/components/ClickAwayHandler"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faChevronLeft } from "@fortawesome/free-solid-svg-icons"; -import useWindowDimensions from "@/hooks/useWindowDimensions"; -import { - faPen, - faBoxesStacked, - faTrashCan, -} from "@fortawesome/free-solid-svg-icons"; -import useLinkStore from "@/store/links"; -import { - CollectionIncludingMembersAndLinkCount, - LinkIncludingShortenedCollectionAndTags, -} from "@/types/global"; -import { useSession } from "next-auth/react"; -import useCollectionStore from "@/store/collections"; -import EditLinkModal from "@/components/ModalContent/EditLinkModal"; -import Link from "next/link"; -import PreservedFormatsModal from "@/components/ModalContent/PreservedFormatsModal"; -import toast from "react-hot-toast"; -import DeleteLinkModal from "@/components/ModalContent/DeleteLinkModal"; - -interface Props { - children: ReactNode; -} - -export default function LinkLayout({ children }: Props) { - const { modal } = useModalStore(); - - const router = useRouter(); - - useEffect(() => { - modal - ? (document.body.style.overflow = "hidden") - : (document.body.style.overflow = "auto"); - }, [modal]); - - const [sidebar, setSidebar] = useState(false); - - const { width } = useWindowDimensions(); - - useEffect(() => { - setSidebar(false); - }, [width]); - - useEffect(() => { - setSidebar(false); - }, [router]); - - const toggleSidebar = () => { - setSidebar(!sidebar); - }; - - const session = useSession(); - const userId = session.data?.user.id; - - const { setModal } = useModalStore(); - - const { links, removeLink } = useLinkStore(); - const { collections } = useCollectionStore(); - - const [linkCollection, setLinkCollection] = - useState