link.url && window.open(link.url || "", "_blank")}
+ className="flex items-center cursor-pointer p-3"
+ >
+
+
+
-
-
- {unescapeString(link.name || link.description) || link.url}
-
+
+
+ {unescapeString(link.name || link.description) || link.url}
+
-
-
-
- ·
- {link.url ? (
-
{
- e.preventDefault();
- window.open(link.url || "", "_blank");
- }}
- className="flex items-center hover:opacity-60 cursor-pointer duration-100"
- >
+
+
+
+ ·
+ {link.url ? (
{shortendURL}
-
- ) : (
-
- {link.type}
-
- )}
+ ) : (
+
+ {link.type}
+
+ )}
+
+
·
+
-
·
-
+
+
-
-
+
+ >
);
}
diff --git a/components/LinkViews/ListView.tsx b/components/LinkViews/ListView.tsx
index bb06327e..8b08add7 100644
--- a/components/LinkViews/ListView.tsx
+++ b/components/LinkViews/ListView.tsx
@@ -7,12 +7,10 @@ export default function ListView({
links: LinkIncludingShortenedCollectionAndTags[];
}) {
return (
-
-
- {links.map((e, i) => {
- return ;
- })}
-
+
+ {links.map((e, i) => {
+ return ;
+ })}
);
}
diff --git a/components/ViewDropdown.tsx b/components/ViewDropdown.tsx
index 2d2ea4ad..ac547e60 100644
--- a/components/ViewDropdown.tsx
+++ b/components/ViewDropdown.tsx
@@ -1,71 +1,71 @@
-import React, {Dispatch, SetStateAction, useEffect, useState} from "react";
+import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
import useLocalSettingsStore from "@/store/localSettings";
-import {ViewMode} from "@/types/global";
+import { ViewMode } from "@/types/global";
type Props = {
- viewMode: string;
- setViewMode: Dispatch
>;
+ viewMode: string;
+ setViewMode: Dispatch>;
};
-export default function ViewDropdown({viewMode, setViewMode}: Props) {
- const {updateSettings} = useLocalSettingsStore();
+export default function ViewDropdown({ viewMode, setViewMode }: Props) {
+ const { updateSettings } = useLocalSettingsStore();
- const onChangeViewMode = (e: React.MouseEvent, viewMode: ViewMode) => {
- setViewMode(viewMode);
- }
+ const onChangeViewMode = (
+ e: React.MouseEvent,
+ viewMode: ViewMode
+ ) => {
+ setViewMode(viewMode);
+ };
- useEffect(() => {
- updateSettings({viewMode: viewMode as ViewMode});
- }, [viewMode]);
+ useEffect(() => {
+ updateSettings({ viewMode: viewMode as ViewMode });
+ }, [viewMode]);
- return (
-
-
-
-
-
- );
+ return (
+
+
+ {/*
*/}
+
+
+ );
}
diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx
index 08ff8dc5..8e1cf1d6 100644
--- a/pages/collections/[id].tsx
+++ b/pages/collections/[id].tsx
@@ -1,4 +1,4 @@
-import LinkCard from "@/components/LinkCard";
+import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
import useCollectionStore from "@/store/collections";
import useLinkStore from "@/store/links";
import { CollectionIncludingMembersAndLinkCount, Sort } from "@/types/global";
diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx
index 0cd4bde0..5788b73b 100644
--- a/pages/dashboard.tsx
+++ b/pages/dashboard.tsx
@@ -13,7 +13,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import MainLayout from "@/layouts/MainLayout";
import useLinkStore from "@/store/links";
import useTagStore from "@/store/tags";
-import LinkCard from "@/components/LinkCard";
+import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
import { useEffect, useState } from "react";
import useLinks from "@/hooks/useLinks";
import Link from "next/link";
diff --git a/pages/links/index.tsx b/pages/links/index.tsx
index 0c4670dd..6eddd6ec 100644
--- a/pages/links/index.tsx
+++ b/pages/links/index.tsx
@@ -1,4 +1,4 @@
-import LinkCard from "@/components/LinkCard";
+import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
import NoLinksFound from "@/components/NoLinksFound";
import SortDropdown from "@/components/SortDropdown";
import useLinks from "@/hooks/useLinks";
@@ -9,21 +9,23 @@ import { faLink } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useState } from "react";
import ViewDropdown from "@/components/ViewDropdown";
-import DefaultGridView from "@/components/LinkViews/DefaultGridView";
-import CompactGridView from "@/components/LinkViews/CompactGridView";
+import DefaultView from "@/components/LinkViews/DefaultView";
+import GridView from "@/components/LinkViews/GridView";
import ListView from "@/components/LinkViews/ListView";
export default function Links() {
const { links } = useLinkStore();
- const [viewMode, setViewMode] = useState(localStorage.getItem('viewMode') || ViewMode.Default);
+ const [viewMode, setViewMode] = useState(
+ localStorage.getItem("viewMode") || ViewMode.Default
+ );
const [sortBy, setSortBy] = useState(Sort.DateNewestFirst);
useLinks({ sort: sortBy });
const components = {
- [ViewMode.Default]: DefaultGridView,
- [ViewMode.Compact]: CompactGridView,
+ [ViewMode.Default]: DefaultView,
+ // [ViewMode.Grid]: GridView,
[ViewMode.List]: ListView,
};
diff --git a/pages/links/pinned.tsx b/pages/links/pinned.tsx
index ac52af2b..d6ba326e 100644
--- a/pages/links/pinned.tsx
+++ b/pages/links/pinned.tsx
@@ -1,4 +1,4 @@
-import LinkCard from "@/components/LinkCard";
+import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
import SortDropdown from "@/components/SortDropdown";
import useLinks from "@/hooks/useLinks";
import MainLayout from "@/layouts/MainLayout";
diff --git a/pages/search.tsx b/pages/search.tsx
index d05a20ad..ac54ca7f 100644
--- a/pages/search.tsx
+++ b/pages/search.tsx
@@ -1,5 +1,5 @@
import FilterSearchDropdown from "@/components/FilterSearchDropdown";
-import LinkCard from "@/components/LinkCard";
+import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
import SortDropdown from "@/components/SortDropdown";
import useLinks from "@/hooks/useLinks";
import MainLayout from "@/layouts/MainLayout";
diff --git a/pages/tags/[id].tsx b/pages/tags/[id].tsx
index 29c417f9..8adfdc47 100644
--- a/pages/tags/[id].tsx
+++ b/pages/tags/[id].tsx
@@ -1,4 +1,4 @@
-import LinkCard from "@/components/LinkCard";
+import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
import useLinkStore from "@/store/links";
import {
faCheck,
diff --git a/types/global.ts b/types/global.ts
index c2356b59..49505bda 100644
--- a/types/global.ts
+++ b/types/global.ts
@@ -59,7 +59,7 @@ export interface PublicCollectionIncludingLinks extends Collection {
export enum ViewMode {
Default = "default",
- Compact = "compact",
+ Grid = "grid",
List = "list",
}