From facbf096045294c7054ec6979391452148e63edd Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 31 May 2023 18:00:45 +0330 Subject: [PATCH] added public page + formatting fixes --- LICENSE.md => LICENSE | 143 ++++++++---------- components/ClickAwayHandler.tsx | 5 - components/CollectionCard.tsx | 7 +- components/Dashboard/CollectionItem.tsx | 5 - components/Dashboard/LinkItem.tsx | 5 - components/Dropdown.tsx | 5 - .../InputSelect/CollectionSelection.tsx | 5 - components/InputSelect/TagSelection.tsx | 5 - components/InputSelect/styles.ts | 5 - components/InputSelect/types.ts | 5 - components/LinkList.tsx | 9 +- components/Loader.tsx | 5 - components/Modal/ChangePassword.tsx | 5 - .../Modal/Collection/CollectionInfo.tsx | 5 - .../Modal/Collection/DeleteCollection.tsx | 5 - .../Modal/Collection/TeamManagement.tsx | 5 - components/Modal/LinkModal.tsx | 5 - components/Modal/UserSettings.tsx | 5 - components/Modal/index.tsx | 5 - components/Navbar.tsx | 5 - components/PublicPage/LinkList.tsx | 81 ++++++++++ components/RequiredBadge.tsx | 5 - components/Search.tsx | 5 - components/Sidebar/SidebarItem.tsx | 5 - components/Sidebar/index.tsx | 5 - components/SortLinkDropdown.tsx | 5 - hooks/useRedirect.tsx | 5 - layouts/AuthRedirect.tsx | 5 - layouts/MainLayout.tsx | 5 - lib/api/archive.ts | 5 - .../collections/deleteCollection.ts | 5 - .../controllers/collections/getCollections.ts | 5 - .../controllers/collections/postCollection.ts | 5 - .../collections/updateCollection.ts | 5 - lib/api/controllers/links/deleteLink.ts | 5 - lib/api/controllers/links/getLinks.ts | 5 - lib/api/controllers/links/postLink.ts | 5 - lib/api/controllers/links/updateLink.ts | 5 - lib/api/controllers/public/getCollection.ts | 5 - lib/api/controllers/tags/getTags.ts | 5 - lib/api/controllers/users/getUsers.ts | 5 - lib/api/controllers/users/updateUser.ts | 5 - lib/api/db.ts | 5 - lib/api/getPermission.ts | 5 - lib/api/getTitle.ts | 5 - lib/client/getInitialData.ts | 5 - lib/client/getPublicCollectionData.ts | 5 - lib/client/getPublicUserDataByEmail.ts | 5 - package.json | 2 +- pages/_app.tsx | 5 - pages/_document.tsx | 5 - pages/api/archives/[...params].ts | 5 - pages/api/auth/[...nextauth].ts | 5 - pages/api/auth/register.ts | 5 - pages/api/avatar/[id].ts | 5 - pages/api/hello.ts | 5 - pages/api/public/routes/collections.ts | 5 - pages/api/routes/collections/index.ts | 5 - pages/api/routes/links/index.ts | 5 - pages/api/routes/tags/index.ts | 5 - pages/api/routes/users/index.ts | 5 - pages/collections/[id].tsx | 7 +- pages/collections/index.tsx | 6 +- pages/dashboard.tsx | 5 - pages/index.tsx | 5 - pages/links.tsx | 5 - pages/login.tsx | 5 - pages/public/collections/[id].tsx | 47 +++++- pages/register.tsx | 5 - pages/search.tsx | 5 - pages/tags/[id].tsx | 5 - prisma/schema.prisma | 5 - store/account.ts | 5 - store/collections.ts | 5 - store/links.ts | 5 - store/localSettings.ts | 5 - store/search.ts | 5 - store/tags.ts | 5 - styles/globals.css | 15 ++ types/global.ts | 7 +- types/next-auth.d.ts | 5 - 81 files changed, 208 insertions(+), 471 deletions(-) rename LICENSE.md => LICENSE (86%) create mode 100644 components/PublicPage/LinkList.tsx diff --git a/LICENSE.md b/LICENSE similarity index 86% rename from LICENSE.md rename to LICENSE index a5eae15..162676c 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ of this license document, but changing it is not allowed. Preamble -The GNU General Public License is a free, copyleft license for -software and other kinds of works. +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. -To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. +Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. -For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. -Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. -For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - -Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ modification follow. 0. Definitions. -"This License" refers to version 3 of the GNU General Public License. +"This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. -13. Use with the GNU Affero General Public License. +13. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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. + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see +For more information on this, and how to apply and follow the GNU AGPL, see . - -The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/components/ClickAwayHandler.tsx b/components/ClickAwayHandler.tsx index 2bddbd1..d577e2f 100644 --- a/components/ClickAwayHandler.tsx +++ b/components/ClickAwayHandler.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { useRef, useEffect, ReactNode, RefObject } from "react"; type Props = { diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index 5efac28..b9c2c4b 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEllipsis } from "@fortawesome/free-solid-svg-icons"; import Link from "next/link"; @@ -63,7 +58,7 @@ export default function ({
-

+

{collection.name}

diff --git a/components/Dashboard/CollectionItem.tsx b/components/Dashboard/CollectionItem.tsx index 6053f69..1827639 100644 --- a/components/Dashboard/CollectionItem.tsx +++ b/components/Dashboard/CollectionItem.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronRight } from "@fortawesome/free-solid-svg-icons"; import Link from "next/link"; diff --git a/components/Dashboard/LinkItem.tsx b/components/Dashboard/LinkItem.tsx index cbc94d0..cab9461 100644 --- a/components/Dashboard/LinkItem.tsx +++ b/components/Dashboard/LinkItem.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { LinkIncludingCollectionAndTags } from "@/types/global"; import { faFolder, diff --git a/components/Dropdown.tsx b/components/Dropdown.tsx index b0cb8d3..7412b7c 100644 --- a/components/Dropdown.tsx +++ b/components/Dropdown.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import Link from "next/link"; import React, { MouseEventHandler } from "react"; import ClickAwayHandler from "./ClickAwayHandler"; diff --git a/components/InputSelect/CollectionSelection.tsx b/components/InputSelect/CollectionSelection.tsx index f86be56..388270a 100644 --- a/components/InputSelect/CollectionSelection.tsx +++ b/components/InputSelect/CollectionSelection.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import useCollectionStore from "@/store/collections"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/components/InputSelect/TagSelection.tsx b/components/InputSelect/TagSelection.tsx index 9f277eb..62c5242 100644 --- a/components/InputSelect/TagSelection.tsx +++ b/components/InputSelect/TagSelection.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import useTagStore from "@/store/tags"; import { useEffect, useState } from "react"; import CreatableSelect from "react-select/creatable"; diff --git a/components/InputSelect/styles.ts b/components/InputSelect/styles.ts index f56833c..b86698a 100644 --- a/components/InputSelect/styles.ts +++ b/components/InputSelect/styles.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { StylesConfig } from "react-select"; const font = diff --git a/components/InputSelect/types.ts b/components/InputSelect/types.ts index ff1a571..dc8cd1f 100644 --- a/components/InputSelect/types.ts +++ b/components/InputSelect/types.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - export interface Options { label: string; value?: string | number; diff --git a/components/LinkList.tsx b/components/LinkList.tsx index ff174d0..b42154f 100644 --- a/components/LinkList.tsx +++ b/components/LinkList.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { LinkIncludingCollectionAndTags } from "@/types/global"; import { faFolder, @@ -45,7 +40,7 @@ export default function ({ link, count }: Props) { }; return ( -
+
{editModal ? (

{count + 1}.

-

{link.name}

+

{link.name}

{link.title}

diff --git a/components/Loader.tsx b/components/Loader.tsx index adfe021..88d12d8 100644 --- a/components/Loader.tsx +++ b/components/Loader.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - export default function () { return (
diff --git a/components/Modal/ChangePassword.tsx b/components/Modal/ChangePassword.tsx index a719f74..43356e0 100644 --- a/components/Modal/ChangePassword.tsx +++ b/components/Modal/ChangePassword.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { useState } from "react"; import { AccountSettings } from "@/types/global"; diff --git a/components/Modal/Collection/CollectionInfo.tsx b/components/Modal/Collection/CollectionInfo.tsx index 158e9a5..a22ec9c 100644 --- a/components/Modal/Collection/CollectionInfo.tsx +++ b/components/Modal/Collection/CollectionInfo.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faPenToSquare, faPlus } from "@fortawesome/free-solid-svg-icons"; diff --git a/components/Modal/Collection/DeleteCollection.tsx b/components/Modal/Collection/DeleteCollection.tsx index 4a2e3b9..ef7c815 100644 --- a/components/Modal/Collection/DeleteCollection.tsx +++ b/components/Modal/Collection/DeleteCollection.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faTrashCan } from "@fortawesome/free-solid-svg-icons"; diff --git a/components/Modal/Collection/TeamManagement.tsx b/components/Modal/Collection/TeamManagement.tsx index d370b57..75ef93f 100644 --- a/components/Modal/Collection/TeamManagement.tsx +++ b/components/Modal/Collection/TeamManagement.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { diff --git a/components/Modal/LinkModal.tsx b/components/Modal/LinkModal.tsx index 30e7ab8..3dbb12b 100644 --- a/components/Modal/LinkModal.tsx +++ b/components/Modal/LinkModal.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { useEffect, useState } from "react"; import CollectionSelection from "@/components/InputSelect/CollectionSelection"; import TagSelection from "@/components/InputSelect/TagSelection"; diff --git a/components/Modal/UserSettings.tsx b/components/Modal/UserSettings.tsx index 1b9aeb3..c7a2dc9 100644 --- a/components/Modal/UserSettings.tsx +++ b/components/Modal/UserSettings.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { useEffect, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faUser, faClose } from "@fortawesome/free-solid-svg-icons"; diff --git a/components/Modal/index.tsx b/components/Modal/index.tsx index b4938b0..e728f4c 100644 --- a/components/Modal/index.tsx +++ b/components/Modal/index.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { MouseEventHandler, ReactNode } from "react"; import ClickAwayHandler from "@/components/ClickAwayHandler"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; diff --git a/components/Navbar.tsx b/components/Navbar.tsx index dc2b9b8..24d5781 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { signOut } from "next-auth/react"; import { diff --git a/components/PublicPage/LinkList.tsx b/components/PublicPage/LinkList.tsx new file mode 100644 index 0000000..0e71755 --- /dev/null +++ b/components/PublicPage/LinkList.tsx @@ -0,0 +1,81 @@ +import { + faArrowUpRightFromSquare, + faChevronRight, +} from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import Image from "next/image"; +import { Link as LinkType } from "@prisma/client"; + +type Props = { + link: Omit; + count: number; +}; + +export default function ({ link, count }: Props) { + const url = new URL(link.url); + const formattedDate = new Date( + link.createdAt as unknown as string + ).toLocaleString("en-US", { + year: "numeric", + month: "short", + day: "numeric", + }); + + return ( + +
+ { + const target = e.target as HTMLElement; + target.style.opacity = "0"; + }} + /> + { + const target = e.target as HTMLElement; + target.style.opacity = "0"; + }} + /> +
+
+
+

{count + 1}.

+

{link.name}

+
+ +

{link.title}

+ +
+

{formattedDate}

+
+

{url.host}

+ +
+
+
+
+ +
+
+
+
+ ); +} diff --git a/components/RequiredBadge.tsx b/components/RequiredBadge.tsx index 40eb3e2..1f9a41b 100644 --- a/components/RequiredBadge.tsx +++ b/components/RequiredBadge.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - export default function RequiredBadge() { return ( diff --git a/components/Search.tsx b/components/Search.tsx index b51c800..5072fc2 100644 --- a/components/Search.tsx +++ b/components/Search.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { faMagnifyingGlass } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useEffect, useState } from "react"; diff --git a/components/Sidebar/SidebarItem.tsx b/components/Sidebar/SidebarItem.tsx index caa401e..8fb8989 100644 --- a/components/Sidebar/SidebarItem.tsx +++ b/components/Sidebar/SidebarItem.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import Link from "next/link"; import React, { ReactElement, useEffect, useState } from "react"; import { useRouter } from "next/router"; diff --git a/components/Sidebar/index.tsx b/components/Sidebar/index.tsx index 835988c..70d931f 100644 --- a/components/Sidebar/index.tsx +++ b/components/Sidebar/index.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import useCollectionStore from "@/store/collections"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { diff --git a/components/SortLinkDropdown.tsx b/components/SortLinkDropdown.tsx index 11d2db7..7c90cfe 100644 --- a/components/SortLinkDropdown.tsx +++ b/components/SortLinkDropdown.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React, { ChangeEvent } from "react"; import ClickAwayHandler from "./ClickAwayHandler"; import RadioButton from "./RadioButton"; diff --git a/hooks/useRedirect.tsx b/hooks/useRedirect.tsx index 64219ee..51e3380 100644 --- a/hooks/useRedirect.tsx +++ b/hooks/useRedirect.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { useEffect, useState } from "react"; import { useSession } from "next-auth/react"; import { useRouter } from "next/router"; diff --git a/layouts/AuthRedirect.tsx b/layouts/AuthRedirect.tsx index 2f879c4..cdc3ad5 100644 --- a/layouts/AuthRedirect.tsx +++ b/layouts/AuthRedirect.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { ReactNode } from "react"; import { useSession } from "next-auth/react"; import Loader from "../components/Loader"; diff --git a/layouts/MainLayout.tsx b/layouts/MainLayout.tsx index 2cfe01a..6a92aea 100644 --- a/layouts/MainLayout.tsx +++ b/layouts/MainLayout.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import Navbar from "@/components/Navbar"; import Sidebar from "@/components/Sidebar"; import { ReactNode } from "react"; diff --git a/lib/api/archive.ts b/lib/api/archive.ts index ef73807..496a464 100644 --- a/lib/api/archive.ts +++ b/lib/api/archive.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { Page } from "puppeteer"; import { prisma } from "@/lib/api/db"; import puppeteer from "puppeteer-extra"; diff --git a/lib/api/controllers/collections/deleteCollection.ts b/lib/api/controllers/collections/deleteCollection.ts index c94c69a..beefc7d 100644 --- a/lib/api/controllers/collections/deleteCollection.ts +++ b/lib/api/controllers/collections/deleteCollection.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import getPermission from "@/lib/api/getPermission"; import fs from "fs"; diff --git a/lib/api/controllers/collections/getCollections.ts b/lib/api/controllers/collections/getCollections.ts index 3e1ab30..88446bf 100644 --- a/lib/api/controllers/collections/getCollections.ts +++ b/lib/api/controllers/collections/getCollections.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; export default async function (userId: number) { diff --git a/lib/api/controllers/collections/postCollection.ts b/lib/api/controllers/collections/postCollection.ts index 5957b95..2aa5170 100644 --- a/lib/api/controllers/collections/postCollection.ts +++ b/lib/api/controllers/collections/postCollection.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import { CollectionIncludingMembers } from "@/types/global"; import { existsSync, mkdirSync } from "fs"; diff --git a/lib/api/controllers/collections/updateCollection.ts b/lib/api/controllers/collections/updateCollection.ts index 1d51130..6387bc8 100644 --- a/lib/api/controllers/collections/updateCollection.ts +++ b/lib/api/controllers/collections/updateCollection.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import { CollectionIncludingMembers } from "@/types/global"; import getPermission from "@/lib/api/getPermission"; diff --git a/lib/api/controllers/links/deleteLink.ts b/lib/api/controllers/links/deleteLink.ts index 308fa84..19f4861 100644 --- a/lib/api/controllers/links/deleteLink.ts +++ b/lib/api/controllers/links/deleteLink.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import { LinkIncludingCollectionAndTags } from "@/types/global"; import fs from "fs"; diff --git a/lib/api/controllers/links/getLinks.ts b/lib/api/controllers/links/getLinks.ts index 651f63a..12ee450 100644 --- a/lib/api/controllers/links/getLinks.ts +++ b/lib/api/controllers/links/getLinks.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; export default async function (userId: number) { const links = await prisma.link.findMany({ diff --git a/lib/api/controllers/links/postLink.ts b/lib/api/controllers/links/postLink.ts index f678a49..2d8076d 100644 --- a/lib/api/controllers/links/postLink.ts +++ b/lib/api/controllers/links/postLink.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import { LinkIncludingCollectionAndTags } from "@/types/global"; import getTitle from "../../getTitle"; diff --git a/lib/api/controllers/links/updateLink.ts b/lib/api/controllers/links/updateLink.ts index 8e73f23..f0684f8 100644 --- a/lib/api/controllers/links/updateLink.ts +++ b/lib/api/controllers/links/updateLink.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import { LinkIncludingCollectionAndTags } from "@/types/global"; import { UsersAndCollections } from "@prisma/client"; diff --git a/lib/api/controllers/public/getCollection.ts b/lib/api/controllers/public/getCollection.ts index c3860fd..d05bb6a 100644 --- a/lib/api/controllers/public/getCollection.ts +++ b/lib/api/controllers/public/getCollection.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; export default async function (collectionId: number) { diff --git a/lib/api/controllers/tags/getTags.ts b/lib/api/controllers/tags/getTags.ts index 92dd3b2..b3bf070 100644 --- a/lib/api/controllers/tags/getTags.ts +++ b/lib/api/controllers/tags/getTags.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; export default async function (userId: number) { diff --git a/lib/api/controllers/users/getUsers.ts b/lib/api/controllers/users/getUsers.ts index 582fdfd..f7efa9f 100644 --- a/lib/api/controllers/users/getUsers.ts +++ b/lib/api/controllers/users/getUsers.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; export default async function ( diff --git a/lib/api/controllers/users/updateUser.ts b/lib/api/controllers/users/updateUser.ts index 9e0e864..1e4201a 100644 --- a/lib/api/controllers/users/updateUser.ts +++ b/lib/api/controllers/users/updateUser.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import { AccountSettings } from "@/types/global"; import fs from "fs"; diff --git a/lib/api/db.ts b/lib/api/db.ts index 66fa5fe..8919c42 100644 --- a/lib/api/db.ts +++ b/lib/api/db.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { PrismaClient } from "@prisma/client"; const globalForPrisma = global as unknown as { prisma: PrismaClient }; diff --git a/lib/api/getPermission.ts b/lib/api/getPermission.ts index a4a07b2..49bbc04 100644 --- a/lib/api/getPermission.ts +++ b/lib/api/getPermission.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; export default async (userId: number, collectionId: number) => { diff --git a/lib/api/getTitle.ts b/lib/api/getTitle.ts index 6fcc53b..07187ee 100644 --- a/lib/api/getTitle.ts +++ b/lib/api/getTitle.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - export default async (url: string) => { const response = await fetch(url); const text = await response.text(); diff --git a/lib/client/getInitialData.ts b/lib/client/getInitialData.ts index a0acd6e..46d9f82 100644 --- a/lib/client/getInitialData.ts +++ b/lib/client/getInitialData.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import useCollectionStore from "@/store/collections"; import { useEffect } from "react"; import { useSession } from "next-auth/react"; diff --git a/lib/client/getPublicCollectionData.ts b/lib/client/getPublicCollectionData.ts index 942802d..d12ad3a 100644 --- a/lib/client/getPublicCollectionData.ts +++ b/lib/client/getPublicCollectionData.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - const getPublicCollectionData = async (collectionId: string) => { const res = await fetch( "/api/public/routes/collections/?collectionId=" + collectionId diff --git a/lib/client/getPublicUserDataByEmail.ts b/lib/client/getPublicUserDataByEmail.ts index d386918..42c097c 100644 --- a/lib/client/getPublicUserDataByEmail.ts +++ b/lib/client/getPublicUserDataByEmail.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - export default async function (email: string) { const response = await fetch(`/api/routes/users?email=${email}`); diff --git a/package.json b/package.json index f5a8016..c633a23 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "main": "index.js", "repository": "https://github.com/Daniel31x13/link-warden.git", "author": "Daniel31X13 ", - "license": "GPL-3.0", + "license": "AGPL-3.0", "private": true, "scripts": { "dev": "next dev", diff --git a/pages/_app.tsx b/pages/_app.tsx index 9b28aac..cfd49fb 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import React from "react"; import "@/styles/globals.css"; import { SessionProvider } from "next-auth/react"; diff --git a/pages/_document.tsx b/pages/_document.tsx index 8fe71a1..b2fff8b 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { Html, Head, Main, NextScript } from "next/document"; export default function Document() { diff --git a/pages/api/archives/[...params].ts b/pages/api/archives/[...params].ts index 317a05f..57797d1 100644 --- a/pages/api/archives/[...params].ts +++ b/pages/api/archives/[...params].ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index 4fa11f7..0f6bf16 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import NextAuth from "next-auth/next"; import CredentialsProvider from "next-auth/providers/credentials"; diff --git a/pages/api/auth/register.ts b/pages/api/auth/register.ts index 1f57328..d0d2006 100644 --- a/pages/api/auth/register.ts +++ b/pages/api/auth/register.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { prisma } from "@/lib/api/db"; import type { NextApiRequest, NextApiResponse } from "next"; import bcrypt from "bcrypt"; diff --git a/pages/api/avatar/[id].ts b/pages/api/avatar/[id].ts index f5cc69d..1ff93aa 100644 --- a/pages/api/avatar/[id].ts +++ b/pages/api/avatar/[id].ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/api/hello.ts b/pages/api/hello.ts index 0225841..b170c05 100644 --- a/pages/api/hello.ts +++ b/pages/api/hello.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/api/public/routes/collections.ts b/pages/api/public/routes/collections.ts index bc87cb6..a687d93 100644 --- a/pages/api/public/routes/collections.ts +++ b/pages/api/public/routes/collections.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import getCollection from "@/lib/api/controllers/public/getCollection"; import type { NextApiRequest, NextApiResponse } from "next"; diff --git a/pages/api/routes/collections/index.ts b/pages/api/routes/collections/index.ts index 096e7e7..f05edce 100644 --- a/pages/api/routes/collections/index.ts +++ b/pages/api/routes/collections/index.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/api/routes/links/index.ts b/pages/api/routes/links/index.ts index 979b308..9beb60d 100644 --- a/pages/api/routes/links/index.ts +++ b/pages/api/routes/links/index.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/api/routes/tags/index.ts b/pages/api/routes/tags/index.ts index c14d9c9..3373c5b 100644 --- a/pages/api/routes/tags/index.ts +++ b/pages/api/routes/tags/index.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/api/routes/users/index.ts b/pages/api/routes/users/index.ts index 4af3e19..8479985 100644 --- a/pages/api/routes/users/index.ts +++ b/pages/api/routes/users/index.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "pages/api/auth/[...nextauth]"; diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx index b123555..8f1f378 100644 --- a/pages/collections/[id].tsx +++ b/pages/collections/[id].tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import Dropdown from "@/components/Dropdown"; import LinkList from "@/components/LinkList"; import Modal from "@/components/Modal"; @@ -111,7 +106,7 @@ export default function () { icon={faFolder} className="sm:w-8 sm:h-8 w-6 h-6 mt-2 text-sky-300" /> -

+

{activeCollection?.name}

diff --git a/pages/collections/index.tsx b/pages/collections/index.tsx index 2e576fa..ef02d81 100644 --- a/pages/collections/index.tsx +++ b/pages/collections/index.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import useCollectionStore from "@/store/collections"; import { faBox, @@ -218,6 +213,7 @@ export default function () { activeCollection={{ name: "", description: "", + isPublic: false, ownerId: session.data?.user.id as number, members: [], }} diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index 4287211..2727539 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import useCollectionStore from "@/store/collections"; import { faArrowRight, faChartSimple } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; diff --git a/pages/index.tsx b/pages/index.tsx index bbfb791..7c4db0c 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { useRouter } from "next/router"; import { useEffect } from "react"; diff --git a/pages/links.tsx b/pages/links.tsx index 903a9df..e585c88 100644 --- a/pages/links.tsx +++ b/pages/links.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import ClickAwayHandler from "@/components/ClickAwayHandler"; import LinkList from "@/components/LinkList"; import RadioButton from "@/components/RadioButton"; diff --git a/pages/login.tsx b/pages/login.tsx index cc23739..f470586 100644 --- a/pages/login.tsx +++ b/pages/login.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { signIn } from "next-auth/react"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/pages/public/collections/[id].tsx b/pages/public/collections/[id].tsx index 5d1ee5a..2575c5e 100644 --- a/pages/public/collections/[id].tsx +++ b/pages/public/collections/[id].tsx @@ -1,3 +1,4 @@ +import LinkList from "@/components/PublicPage/LinkList"; import getPublicCollectionData from "@/lib/client/getPublicCollectionData"; import { PublicCollectionIncludingLinks } from "@/types/global"; import { useRouter } from "next/router"; @@ -9,21 +10,53 @@ export default function PublicCollections() { const [data, setData] = useState(); useEffect(() => { - const init = async () => { + const setState = async () => { if (router.query.id) { const data = await getPublicCollectionData(router.query.id as string); - setData(data); + setData(data.response); } }; - init(); + setState(); + + // document + // .querySelector("body") + // ?.classList.add( + // "bg-gradient-to-br", + // "from-slate-50", + // "to-sky-50", + // "min-h-screen" + // ); }, []); - return ( -
-

Hello

- {JSON.stringify(data)} + return data ? ( +
+
+

+ {data.name} +

+ + {data.ownerName && ( +

{"By " + data.ownerName}

+ )} + +
+ +

{data.description}

+
+ +
+ {data?.links.map((e, i) => { + return ; + })} +
+ +

+ List created with Linkwarden. +

+ ) : ( + <> ); } diff --git a/pages/register.tsx b/pages/register.tsx index 29e939b..9251555 100644 --- a/pages/register.tsx +++ b/pages/register.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/router"; diff --git a/pages/search.tsx b/pages/search.tsx index 2d448e1..6cb2474 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import Checkbox from "@/components/Checkbox"; import ClickAwayHandler from "@/components/ClickAwayHandler"; import LinkList from "@/components/LinkList"; diff --git a/pages/tags/[id].tsx b/pages/tags/[id].tsx index cce0372..1a4d1e5 100644 --- a/pages/tags/[id].tsx +++ b/pages/tags/[id].tsx @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import LinkList from "@/components/LinkList"; import useLinkStore from "@/store/links"; import { faHashtag, faSort } from "@fortawesome/free-solid-svg-icons"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 10f14df..425070b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - generator client { provider = "prisma-client-js" } diff --git a/store/account.ts b/store/account.ts index 4b430d6..f0f4e31 100644 --- a/store/account.ts +++ b/store/account.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { create } from "zustand"; import { AccountSettings } from "@/types/global"; import avatarExists from "@/lib/client/avatarExists"; diff --git a/store/collections.ts b/store/collections.ts index 907debf..707133a 100644 --- a/store/collections.ts +++ b/store/collections.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { create } from "zustand"; import { CollectionIncludingMembers } from "@/types/global"; import useTagStore from "./tags"; diff --git a/store/links.ts b/store/links.ts index 7976317..6c75303 100644 --- a/store/links.ts +++ b/store/links.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { create } from "zustand"; import { LinkIncludingCollectionAndTags } from "@/types/global"; import useTagStore from "./tags"; diff --git a/store/localSettings.ts b/store/localSettings.ts index e8537bf..8eebcef 100644 --- a/store/localSettings.ts +++ b/store/localSettings.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { create } from "zustand"; type LocalSettings = { diff --git a/store/search.ts b/store/search.ts index 62ef8b5..5c92637 100644 --- a/store/search.ts +++ b/store/search.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { SearchSettings } from "@/types/global"; import { create } from "zustand"; diff --git a/store/tags.ts b/store/tags.ts index e4d364f..17b5c52 100644 --- a/store/tags.ts +++ b/store/tags.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { create } from "zustand"; import { Tag } from "@prisma/client"; diff --git a/styles/globals.css b/styles/globals.css index 76cc6d6..b8f92d1 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -74,3 +74,18 @@ transform: translateX(0); } } + +.slide-right-with-fade { + animation: slide-right-animation 150ms; +} + +@keyframes slide-right-animation { + 0% { + transform: translateX(-50%); + opacity: 0; + } + 100% { + transform: translateX(0); + opacity: 1; + } +} diff --git a/types/global.ts b/types/global.ts index 78d695a..c9930bf 100644 --- a/types/global.ts +++ b/types/global.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import { Collection, Link, Tag, User } from "@prisma/client"; type OptionalExcluding = Partial & @@ -53,5 +48,5 @@ export type SearchSettings = { export interface PublicCollectionIncludingLinks extends Omit { ownerName?: string; - links: Omit; + links: Omit[]; } diff --git a/types/next-auth.d.ts b/types/next-auth.d.ts index 47439a1..cb9674b 100644 --- a/types/next-auth.d.ts +++ b/types/next-auth.d.ts @@ -1,8 +1,3 @@ -// Copyright (C) 2022-present Daniel31x13 -// 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 . - import NextAuth, { DefaultSession } from "next-auth"; declare module "next-auth" {