diff --git a/components/CollectionListing.tsx b/components/CollectionListing.tsx
index 1533c3b..0bc2c9d 100644
--- a/components/CollectionListing.tsx
+++ b/components/CollectionListing.tsx
@@ -273,13 +273,13 @@ const renderItem = (
icon={collection.icon}
size={30}
weight={(collection.iconWeight || "regular") as IconWeight}
- color={collection.color || "#0ea5e9"}
+ color={collection.color}
className="-mr-[0.15rem]"
/>
) : (
)}
diff --git a/components/EditButton.tsx b/components/EditButton.tsx
new file mode 100644
index 0000000..8286061
--- /dev/null
+++ b/components/EditButton.tsx
@@ -0,0 +1,25 @@
+import React from "react";
+import { useTranslation } from "next-i18next";
+import clsx from "clsx";
+
+type Props = {
+ onClick: Function;
+ className?: string;
+};
+
+function EditButton({ onClick, className }: Props) {
+ const { t } = useTranslation();
+
+ return (
+ onClick()}
+ className={clsx(
+ "group-hover:opacity-100 opacity-0 duration-100 btn-square btn-xs btn btn-ghost absolute bi-pencil-fill text-neutral cursor-pointer -right-7 text-xs",
+ className
+ )}
+ title={t("edit")}
+ >
+ );
+}
+
+export default EditButton;
diff --git a/components/IconPicker.tsx b/components/IconPicker.tsx
index f561137..82643a8 100644
--- a/components/IconPicker.tsx
+++ b/components/IconPicker.tsx
@@ -6,6 +6,8 @@ import { useTranslation } from "next-i18next";
import Icon from "./Icon";
import { IconWeight } from "@phosphor-icons/react";
import IconGrid from "./IconGrid";
+import IconPopover from "./IconPopover";
+import clsx from "clsx";
type Props = {
alignment?: string;
@@ -33,7 +35,6 @@ const IconPicker = ({
reset,
}: Props) => {
const { t } = useTranslation();
- const [query, setQuery] = useState("");
const [iconPicker, setIconPicker] = useState(false);
return (
@@ -59,57 +60,21 @@ const IconPicker = ({
)}
{iconPicker && (
-
{link.name}
} + {fieldToEdit !== "name" ? ( +
+ {link.name || t("untitled")}
+
{t("link")}
{t("collection")}
+
+ {t("collection")}
+ {fieldToEdit !== "collection" && (
+
{link.collection.name}
-{link.collection.name}
+{t("tags")}
-
+ {t("tags")}
+ {fieldToEdit !== "tags" && (
+
{t("notes")}
+
+ {t("description")}
+ {fieldToEdit !== "description" && (
+
{link.description}
-{t("no_description_provided")}
+ )}+ {t("saved")}{" "} + {new Date(link.createdAt || "").toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + })}{" "} + at{" "} + {new Date(link.createdAt || "").toLocaleTimeString("en-US", { + hour: "numeric", + minute: "numeric", + })} +
{collection?.name}
diff --git a/components/LinkViews/LinkComponents/LinkIcon.tsx b/components/LinkViews/LinkComponents/LinkIcon.tsx index c5208f1..93a70aa 100644 --- a/components/LinkViews/LinkComponents/LinkIcon.tsx +++ b/components/LinkViews/LinkComponents/LinkIcon.tsx @@ -10,10 +10,12 @@ export default function LinkIcon({ link, className, hideBackground, + onClick, }: { link: LinkIncludingShortenedCollectionAndTags; className?: string; hideBackground?: boolean; + onClick?: Function; }) { let iconClasses: string = clsx( "rounded flex item-center justify-center shadow select-none z-10 w-12 h-12", @@ -27,14 +29,14 @@ export default function LinkIcon({ const [showFavicon, setShowFavicon] = React.useState{t("icon_and_preview")}
-- {t("preview_unavailable")} -
-{name}
diff --git a/components/ReadableView.tsx b/components/ReadableView.tsx index b352489..942b66c 100644 --- a/components/ReadableView.tsx +++ b/components/ReadableView.tsx @@ -212,12 +212,12 @@ export default function ReadableView({ link }: Props) { weight={ (link.collection.iconWeight || "regular") as IconWeight } - color={link.collection.color || "#0ea5e9"} + color={link.collection.color} /> ) : ( )} ) : ( )} diff --git a/pages/links/[id].tsx b/pages/links/[id].tsx index bacd5b3..bb69769 100644 --- a/pages/links/[id].tsx +++ b/pages/links/[id].tsx @@ -20,7 +20,7 @@ const Index = () => {
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 3a890ca..a5f820f 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -372,7 +372,6 @@
"demo_desc": "This is only a demo instance of Linkwarden and uploads are disabled.",
"demo_desc_2": "If you want to try out the full version, you can sign up for a free trial at:",
"demo_button": "Login as demo user",
- "notes": "Notes",
"regular": "Regular",
"thin": "Thin",
"bold": "Bold",
@@ -387,5 +386,10 @@
"icon": "Icon",
"date": "Date",
"preview_unavailable": "Preview Unavailable",
- "icon_and_preview": "Icon & Preview"
+ "saved": "Saved",
+ "untitled": "Untitled",
+ "no_tags": "No tags.",
+ "no_description_provided": "No description provided.",
+ "change_icon": "Change Icon",
+ "upload_preview_image": "Upload Preview Image"
}
\ No newline at end of file
diff --git a/styles/globals.css b/styles/globals.css
index 28a0105..de596a4 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -162,6 +162,19 @@
height: fit-content;
}
+.react-select__indicator-separator {
+ display: none;
+}
+
+.react-select__control--is-focused .react-select__dropdown-indicator,
+.react-select__control .react-select__dropdown-indicator,
+.react-select__control .react-select__dropdown-indicator:hover,
+.react-select__control .react-select__dropdown-indicator:focus,
+.react-select__control--is-focused .react-select__dropdown-indicator:hover,
+.react-select__control--is-focused .react-select__dropdown-indicator:focus {
+ color: oklch(var(--n));
+}
+
/* Theme */
@layer components {
@@ -169,13 +182,13 @@
@apply bg-base-200 hover:border-neutral-content;
}
+ .react-select-container .react-select__control--is-focused {
+ @apply border-primary hover:border-primary;
+ }
+
.react-select-container .react-select__menu {
@apply bg-base-100 border-neutral-content border rounded-md;
}
- /*
- .react-select-container .react-select__menu-list {
- @apply h-20;
- } */
.react-select-container .react-select__input-container,
.react-select-container .react-select__single-value {
diff --git a/types/global.ts b/types/global.ts
index cc3d962..2be9f81 100644
--- a/types/global.ts
+++ b/types/global.ts
@@ -22,6 +22,7 @@ export interface LinkIncludingShortenedCollectionAndTags
pinnedBy?: {
id: number;
}[];
+ updatedAt?: string;
collection: OptionalExcluding