bug fixes + small visual improvements
This commit is contained in:
@@ -54,7 +54,7 @@ export default function ({ onChange, defaultValue }: Props) {
|
|||||||
options={options}
|
options={options}
|
||||||
styles={styles}
|
styles={styles}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
menuPosition="fixed"
|
// menuPosition="fixed"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default function ({ onChange, defaultValue }: Props) {
|
|||||||
options={options}
|
options={options}
|
||||||
styles={styles}
|
styles={styles}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
menuPosition="fixed"
|
// menuPosition="fixed"
|
||||||
isMulti
|
isMulti
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ export const styles: StylesConfig = {
|
|||||||
width: "15rem",
|
width: "15rem",
|
||||||
border: "1px solid #e0f2fe",
|
border: "1px solid #e0f2fe",
|
||||||
borderRadius: "0.375rem",
|
borderRadius: "0.375rem",
|
||||||
fontSize: "0.875rem",
|
|
||||||
lineHeight: "1.25rem",
|
lineHeight: "1.25rem",
|
||||||
|
// "@media screen and (min-width: 1024px)": {
|
||||||
|
// fontSize: "0.875rem",
|
||||||
|
// },
|
||||||
}),
|
}),
|
||||||
input: (styles) => ({
|
input: (styles) => ({
|
||||||
...styles,
|
...styles,
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default function ({
|
|||||||
width={32}
|
width={32}
|
||||||
height={32}
|
height={32}
|
||||||
alt=""
|
alt=""
|
||||||
className="select-none mt-3 z-10 rounded-md shadow"
|
className="select-none mt-3 z-10 rounded-md"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
@@ -70,7 +70,7 @@ export default function ({
|
|||||||
width={80}
|
width={80}
|
||||||
height={80}
|
height={80}
|
||||||
alt=""
|
alt=""
|
||||||
className="blur-sm absolute left-2 opacity-50 select-none hidden sm:block"
|
className="blur-sm absolute left-2 opacity-40 select-none hidden sm:block"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
@@ -194,7 +194,7 @@ export default function ({
|
|||||||
const target = e.target as HTMLInputElement;
|
const target = e.target as HTMLInputElement;
|
||||||
if (target.id !== "edit-dropdown") setExpandDropdown(false);
|
if (target.id !== "edit-dropdown") setExpandDropdown(false);
|
||||||
}}
|
}}
|
||||||
className="absolute top-9 right-0 w-36"
|
className="absolute top-8 right-0 w-36"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { faClose, faPlus } from "@fortawesome/free-solid-svg-icons";
|
|||||||
import useCollectionStore from "@/store/collections";
|
import useCollectionStore from "@/store/collections";
|
||||||
import { NewCollection } from "@/types/global";
|
import { NewCollection } from "@/types/global";
|
||||||
import { useSession } from "next-auth/react";
|
import { useSession } from "next-auth/react";
|
||||||
|
import RequiredBadge from "../RequiredBadge";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
toggleCollectionModal: Function;
|
toggleCollectionModal: Function;
|
||||||
@@ -48,7 +49,10 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
|
|||||||
<p className="font-bold text-sky-300 mb-2 text-center">New Collection</p>
|
<p className="font-bold text-sky-300 mb-2 text-center">New Collection</p>
|
||||||
|
|
||||||
<div className="flex gap-5 items-center justify-between">
|
<div className="flex gap-5 items-center justify-between">
|
||||||
<p className="text-sm font-bold text-sky-300">Name</p>
|
<p className="text-sm font-bold text-sky-300">
|
||||||
|
Name
|
||||||
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
<input
|
<input
|
||||||
value={newCollection.name}
|
value={newCollection.name}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
@@ -56,7 +60,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
|
|||||||
}
|
}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g. Example Collection"
|
placeholder="e.g. Example Collection"
|
||||||
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -68,8 +72,8 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
|
|||||||
setNewCollection({ ...newCollection, description: e.target.value })
|
setNewCollection({ ...newCollection, description: e.target.value })
|
||||||
}
|
}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Collection description (Optional)"
|
placeholder="Collection description"
|
||||||
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -120,8 +124,8 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Email (Optional)"
|
placeholder="Email"
|
||||||
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { ExtendedLink, NewLink } from "@/types/global";
|
|||||||
import useLinkStore from "@/store/links";
|
import useLinkStore from "@/store/links";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useCollectionStore from "@/store/collections";
|
import useCollectionStore from "@/store/collections";
|
||||||
|
import RequiredBadge from "../RequiredBadge";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
toggleLinkModal: Function;
|
toggleLinkModal: Function;
|
||||||
@@ -79,34 +80,38 @@ export default function AddLink({ toggleLinkModal }: Props) {
|
|||||||
<p className="font-bold text-sky-300 mb-2 text-center">New Link</p>
|
<p className="font-bold text-sky-300 mb-2 text-center">New Link</p>
|
||||||
|
|
||||||
<div className="flex gap-5 items-center justify-between">
|
<div className="flex gap-5 items-center justify-between">
|
||||||
<p className="text-sm font-bold text-sky-300">Name</p>
|
<p className="text-sm font-bold text-sky-300">
|
||||||
|
Name
|
||||||
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
<input
|
<input
|
||||||
value={newLink.name}
|
value={newLink.name}
|
||||||
onChange={(e) => setNewLink({ ...newLink, name: e.target.value })}
|
onChange={(e) => setNewLink({ ...newLink, name: e.target.value })}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g. Example Link"
|
placeholder="e.g. Example Link"
|
||||||
className="w-60 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-60 rounded-md p-2 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-5 items-center justify-between">
|
<div className="flex gap-5 items-center justify-between">
|
||||||
<p className="text-sm font-bold text-sky-300">URL</p>
|
<p className="text-sm font-bold text-sky-300">
|
||||||
|
URL
|
||||||
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
<input
|
<input
|
||||||
value={newLink.url}
|
value={newLink.url}
|
||||||
onChange={(e) => setNewLink({ ...newLink, url: e.target.value })}
|
onChange={(e) => setNewLink({ ...newLink, url: e.target.value })}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g. http://example.com/"
|
placeholder="e.g. http://example.com/"
|
||||||
className="w-60 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-60 rounded-md p-2 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-5 items-center justify-between">
|
<div className="flex gap-5 items-center justify-between">
|
||||||
<p className="text-sm font-bold text-sky-300">Tags</p>
|
<p className="text-sm font-bold text-sky-300">
|
||||||
<TagSelection onChange={setTags} />
|
Collection
|
||||||
</div>
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
<div className="flex gap-5 items-center justify-between">
|
|
||||||
<p className="text-sm font-bold text-sky-300">Collection</p>
|
|
||||||
<CollectionSelection
|
<CollectionSelection
|
||||||
defaultValue={
|
defaultValue={
|
||||||
newLink.collection.name && newLink.collection.id
|
newLink.collection.name && newLink.collection.id
|
||||||
@@ -117,6 +122,11 @@ export default function AddLink({ toggleLinkModal }: Props) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="flex gap-5 items-center justify-between">
|
||||||
|
<p className="text-sm font-bold text-sky-300">Tags</p>
|
||||||
|
<TagSelection onChange={setTags} />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="mx-auto mt-2 bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"
|
className="mx-auto mt-2 bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"
|
||||||
onClick={submit}
|
onClick={submit}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default function AddCollection({
|
|||||||
onChange={(e) => setInputField(e.target.value)}
|
onChange={(e) => setInputField(e.target.value)}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder={`Type "${collection.name}" Here.`}
|
placeholder={`Type "${collection.name}" Here.`}
|
||||||
className=" w-72 sm:w-96 rounded-md p-3 mx-auto border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className=" w-72 sm:w-96 rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { useSession } from "next-auth/react";
|
|||||||
import getPublicUserDataByEmail from "@/lib/client/getPublicUserDataByEmail";
|
import getPublicUserDataByEmail from "@/lib/client/getPublicUserDataByEmail";
|
||||||
import Modal from "@/components/Modal";
|
import Modal from "@/components/Modal";
|
||||||
import DeleteCollection from "@/components/Modal/DeleteCollection";
|
import DeleteCollection from "@/components/Modal/DeleteCollection";
|
||||||
|
import RequiredBadge from "../RequiredBadge";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
toggleCollectionModal: Function;
|
toggleCollectionModal: Function;
|
||||||
@@ -56,7 +57,10 @@ export default function EditCollection({
|
|||||||
<p className="font-bold text-sky-300 mb-2 text-center">Edit Collection</p>
|
<p className="font-bold text-sky-300 mb-2 text-center">Edit Collection</p>
|
||||||
|
|
||||||
<div className="flex gap-5 items-center justify-between">
|
<div className="flex gap-5 items-center justify-between">
|
||||||
<p className="text-sm font-bold text-sky-300">Name</p>
|
<p className="text-sm font-bold text-sky-300">
|
||||||
|
Name
|
||||||
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
<input
|
<input
|
||||||
value={activeCollection.name}
|
value={activeCollection.name}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
@@ -64,7 +68,7 @@ export default function EditCollection({
|
|||||||
}
|
}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g. Example Collection"
|
placeholder="e.g. Example Collection"
|
||||||
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -79,8 +83,8 @@ export default function EditCollection({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Collection description (Optional)"
|
placeholder="Collection description"
|
||||||
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -135,8 +139,8 @@ export default function EditCollection({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Email (Optional)"
|
placeholder="Email"
|
||||||
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-56 sm:w-96 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { ExtendedLink } from "@/types/global";
|
|||||||
import { faPenToSquare } from "@fortawesome/free-regular-svg-icons";
|
import { faPenToSquare } from "@fortawesome/free-regular-svg-icons";
|
||||||
import useLinkStore from "@/store/links";
|
import useLinkStore from "@/store/links";
|
||||||
import { faTrashCan } from "@fortawesome/free-solid-svg-icons";
|
import { faTrashCan } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
import RequiredBadge from "../RequiredBadge";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
toggleLinkModal: Function;
|
toggleLinkModal: Function;
|
||||||
@@ -53,7 +54,10 @@ export default function EditLink({ toggleLinkModal, link }: Props) {
|
|||||||
<b>{shortendURL}</b> | {link.title}
|
<b>{shortendURL}</b> | {link.title}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex gap-5 items-center justify-between">
|
<div className="flex gap-5 items-center justify-between">
|
||||||
<p className="text-sm font-bold text-sky-300">Name</p>
|
<p className="text-sm font-bold text-sky-300">
|
||||||
|
Name
|
||||||
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
<input
|
<input
|
||||||
value={currentLink.name}
|
value={currentLink.name}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
@@ -61,7 +65,21 @@ export default function EditLink({ toggleLinkModal, link }: Props) {
|
|||||||
}
|
}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g. Example Link"
|
placeholder="e.g. Example Link"
|
||||||
className="w-60 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
className="w-60 rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex gap-5 items-center justify-between">
|
||||||
|
<p className="text-sm font-bold text-sky-300">
|
||||||
|
Collection
|
||||||
|
<RequiredBadge />
|
||||||
|
</p>
|
||||||
|
<CollectionSelection
|
||||||
|
onChange={setCollection}
|
||||||
|
defaultValue={{
|
||||||
|
label: link.collection.name,
|
||||||
|
value: link.collection.id,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -75,17 +93,6 @@ export default function EditLink({ toggleLinkModal, link }: Props) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-5 items-center justify-between">
|
|
||||||
<p className="text-sm font-bold text-sky-300">Collection</p>
|
|
||||||
<CollectionSelection
|
|
||||||
onChange={setCollection}
|
|
||||||
defaultValue={{
|
|
||||||
label: link.collection.name,
|
|
||||||
value: link.collection.id,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-col justify-center items-center gap-2 mt-2">
|
<div className="flex flex-col justify-center items-center gap-2 mt-2">
|
||||||
<div
|
<div
|
||||||
className="bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"
|
className="bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function ({ toggleModal, children }: Props) {
|
|||||||
>
|
>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faChevronLeft}
|
icon={faChevronLeft}
|
||||||
className="w-4 h-4 text-gray-500"
|
className="w-5 h-5 text-gray-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function () {
|
|||||||
id="search-box"
|
id="search-box"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search for Links"
|
placeholder="Search for Links"
|
||||||
className="border border-sky-100 rounded-md pr-6 w-60 focus:border-sky-500 sm:focus:w-80 hover:border-sky-500 duration-100 outline-none p-1 text-sm"
|
className="border border-sky-100 rounded-md pr-6 w-60 focus:border-sky-500 sm:focus:w-80 hover:border-sky-500 duration-100 outline-none p-1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
@@ -77,7 +77,7 @@ export default function () {
|
|||||||
title="New Link"
|
title="New Link"
|
||||||
className="inline-flex gap-1 items-center select-none cursor-pointer p-1 text-sky-500 rounded-md hover:outline-sky-500 outline duration-100 bg-white outline-sky-100 outline-1"
|
className="inline-flex gap-1 items-center select-none cursor-pointer p-1 text-sky-500 rounded-md hover:outline-sky-500 outline duration-100 bg-white outline-sky-100 outline-1"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faPlus} className="w-5 h-5" />
|
<FontAwesomeIcon icon={faPlus} className="w-6 h-6" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{linkModal ? (
|
{linkModal ? (
|
||||||
@@ -94,7 +94,7 @@ export default function () {
|
|||||||
>
|
>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faCircleUser}
|
icon={faCircleUser}
|
||||||
className="h-5 w-5 pointer-events-none"
|
className="h-6 w-6 pointer-events-none"
|
||||||
/>
|
/>
|
||||||
<div className="flex items-center gap-1 pointer-events-none">
|
<div className="flex items-center gap-1 pointer-events-none">
|
||||||
<p className="font-bold leading-3 hidden sm:block">
|
<p className="font-bold leading-3 hidden sm:block">
|
||||||
@@ -123,7 +123,7 @@ export default function () {
|
|||||||
const target = e.target as HTMLInputElement;
|
const target = e.target as HTMLInputElement;
|
||||||
if (target.id !== "profile-dropdown") setProfileDropdown(false);
|
if (target.id !== "profile-dropdown") setProfileDropdown(false);
|
||||||
}}
|
}}
|
||||||
className="absolute top-8 right-0 z-20 w-36"
|
className="absolute top-9 right-0 z-20 w-36"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (C) 2022-present Daniel31x13 <daniel31x13@gmail.com>
|
||||||
|
// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
|
||||||
|
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
// You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
export default function RequiredBadge() {
|
||||||
|
return (
|
||||||
|
<span title="Required Field" className="text-sky-500 cursor-help">
|
||||||
|
{" "}
|
||||||
|
*
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -41,5 +41,5 @@ export default function ({ children }: Props) {
|
|||||||
}, [status]);
|
}, [status]);
|
||||||
|
|
||||||
if (status !== "loading" && !redirect) return <>{children}</>;
|
if (status !== "loading" && !redirect) return <>{children}</>;
|
||||||
// else return <Loader />;
|
else return <></>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,18 @@ export default async function (collection: NewCollection, userId: number) {
|
|||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
members: {
|
||||||
|
include: {
|
||||||
|
user: {
|
||||||
|
select: {
|
||||||
|
email: true,
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const collectionPath = `data/archives/${newCollection.id}`;
|
const collectionPath = `data/archives/${newCollection.id}`;
|
||||||
|
|||||||
@@ -41,6 +41,18 @@ export default async function (collection: ExtendedCollection, userId: number) {
|
|||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
members: {
|
||||||
|
include: {
|
||||||
|
user: {
|
||||||
|
select: {
|
||||||
|
email: true,
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default function () {
|
|||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faEllipsis}
|
icon={faEllipsis}
|
||||||
id="edit-dropdown"
|
id="edit-dropdown"
|
||||||
className="w-4 h-4 text-gray-500"
|
className="w-5 h-5 text-gray-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{expandDropdown ? (
|
{expandDropdown ? (
|
||||||
@@ -113,7 +113,7 @@ export default function () {
|
|||||||
const target = e.target as HTMLInputElement;
|
const target = e.target as HTMLInputElement;
|
||||||
if (target.id !== "edit-dropdown") setExpandDropdown(false);
|
if (target.id !== "edit-dropdown") setExpandDropdown(false);
|
||||||
}}
|
}}
|
||||||
className="absolute top-7 left-0 z-10 w-44"
|
className="absolute top-8 left-0 z-10 w-44"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export default function () {
|
|||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faEllipsis}
|
icon={faEllipsis}
|
||||||
id="edit-dropdown"
|
id="edit-dropdown"
|
||||||
className="w-4 h-4 text-gray-500"
|
className="w-5 h-5 text-gray-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{expandDropdown ? (
|
{expandDropdown ? (
|
||||||
@@ -65,7 +65,7 @@ export default function () {
|
|||||||
const target = e.target as HTMLInputElement;
|
const target = e.target as HTMLInputElement;
|
||||||
if (target.id !== "edit-dropdown") setExpandDropdown(false);
|
if (target.id !== "edit-dropdown") setExpandDropdown(false);
|
||||||
}}
|
}}
|
||||||
className="absolute top-7 left-0 w-36"
|
className="absolute top-8 left-0 w-36"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const useCollectionStore = create<CollectionStore>()((set) => ({
|
|||||||
if (response.ok)
|
if (response.ok)
|
||||||
set((state) => ({
|
set((state) => ({
|
||||||
collections: state.collections.map((e) =>
|
collections: state.collections.map((e) =>
|
||||||
e.id === collection.id ? collection : e
|
e.id === data.response.id ? data.response : e
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user