diff --git a/components/MobileNavigation.tsx b/components/MobileNavigation.tsx
new file mode 100644
index 0000000..aecafc5
--- /dev/null
+++ b/components/MobileNavigation.tsx
@@ -0,0 +1,113 @@
+import { dropdownTriggerer } from "@/lib/client/utils";
+import React from "react";
+import { useEffect, useState } from "react";
+import NewLinkModal from "./ModalContent/NewLinkModal";
+import NewCollectionModal from "./ModalContent/NewCollectionModal";
+import UploadFileModal from "./ModalContent/UploadFileModal";
+import MobileNavigationButton from "./MobileNavigationButton";
+
+type Props = {};
+
+export default function MobileNavigation({}: Props) {
+ const [hasScrolled, setHasScrolled] = useState(false);
+ const [newLinkModal, setNewLinkModal] = useState(false);
+ const [newCollectionModal, setNewCollectionModal] = useState(false);
+ const [uploadFileModal, setUploadFileModal] = useState(false);
+
+ useEffect(() => {
+ const handleScroll = () => {
+ if (window.scrollY > 0) {
+ setHasScrolled(true);
+ } else {
+ setHasScrolled(false);
+ }
+ };
+
+ window.addEventListener("scroll", handleScroll);
+
+ return () => {
+ window.removeEventListener("scroll", handleScroll);
+ };
+ }, []);
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+ -
+
{
+ (document?.activeElement as HTMLElement)?.blur();
+ setNewLinkModal(true);
+ }}
+ tabIndex={0}
+ role="button"
+ >
+ New Link
+
+
+ {/* -
+
{
+ (document?.activeElement as HTMLElement)?.blur();
+ setUploadFileModal(true);
+ }}
+ tabIndex={0}
+ role="button"
+ >
+ Upload File
+
+ */}
+ -
+
{
+ (document?.activeElement as HTMLElement)?.blur();
+ setNewCollectionModal(true);
+ }}
+ tabIndex={0}
+ role="button"
+ >
+ New Collection
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {newLinkModal ? (
+ setNewLinkModal(false)} />
+ ) : undefined}
+ {newCollectionModal ? (
+ setNewCollectionModal(false)} />
+ ) : undefined}
+ {uploadFileModal ? (
+ setUploadFileModal(false)} />
+ ) : undefined}
+ >
+ );
+}
diff --git a/components/MobileNavigationButton.tsx b/components/MobileNavigationButton.tsx
new file mode 100644
index 0000000..1aa31f7
--- /dev/null
+++ b/components/MobileNavigationButton.tsx
@@ -0,0 +1,32 @@
+import Link from "next/link";
+import { useRouter } from "next/router";
+import { useEffect, useState } from "react";
+
+export default function MobileNavigationButton({
+ href,
+ icon,
+}: {
+ href: string;
+ icon: string;
+}) {
+ const router = useRouter();
+ const [active, setActive] = useState(false);
+
+ useEffect(() => {
+ setActive(href === router.asPath);
+ }, [router]);
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/components/Navbar.tsx b/components/Navbar.tsx
index c0ca7f4..eee0208 100644
--- a/components/Navbar.tsx
+++ b/components/Navbar.tsx
@@ -14,7 +14,7 @@ import NewCollectionModal from "./ModalContent/NewCollectionModal";
import Link from "next/link";
import UploadFileModal from "./ModalContent/UploadFileModal";
import { dropdownTriggerer } from "@/lib/client/utils";
-import NewButtonMobile from "./NewButtonMobile";
+import MobileNavigation from "./MobileNavigation";
export default function Navbar() {
const { settings, updateSettings } = useLocalSettingsStore();
@@ -56,7 +56,7 @@ export default function Navbar() {
setSidebar(true);
document.body.style.overflow = "hidden";
}}
- className="text-neutral btn btn-square btn-sm btn-ghost lg:hidden"
+ className="text-neutral btn btn-square btn-sm btn-ghost lg:hidden hidden sm:inline-flex"
>
@@ -171,7 +171,7 @@ export default function Navbar() {
-
+
{sidebar ? (
diff --git a/components/NewButtonMobile.tsx b/components/NewButtonMobile.tsx
deleted file mode 100644
index 91988d3..0000000
--- a/components/NewButtonMobile.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-import { dropdownTriggerer } from "@/lib/client/utils";
-import React from "react";
-import { useEffect, useState } from "react";
-import NewLinkModal from "./ModalContent/NewLinkModal";
-import NewCollectionModal from "./ModalContent/NewCollectionModal";
-import UploadFileModal from "./ModalContent/UploadFileModal";
-
-type Props = {};
-
-export default function NewButtonMobile({}: Props) {
- const [hasScrolled, setHasScrolled] = useState(false);
- const [newLinkModal, setNewLinkModal] = useState(false);
- const [newCollectionModal, setNewCollectionModal] = useState(false);
- const [uploadFileModal, setUploadFileModal] = useState(false);
-
- useEffect(() => {
- const handleScroll = () => {
- if (window.scrollY > 0) {
- setHasScrolled(true);
- } else {
- setHasScrolled(false);
- }
- };
-
- window.addEventListener("scroll", handleScroll);
-
- return () => {
- window.removeEventListener("scroll", handleScroll);
- };
- }, []);
-
- return (
- <>
-
-
-
-
-
-
-
- -
-
{
- (document?.activeElement as HTMLElement)?.blur();
- setNewLinkModal(true);
- }}
- tabIndex={0}
- role="button"
- >
- New Link
-
-
- {/* -
-
{
- (document?.activeElement as HTMLElement)?.blur();
- setUploadFileModal(true);
- }}
- tabIndex={0}
- role="button"
- >
- Upload File
-
- */}
- -
-
{
- (document?.activeElement as HTMLElement)?.blur();
- setNewCollectionModal(true);
- }}
- tabIndex={0}
- role="button"
- >
- New Collection
-
-
-
-
- {newLinkModal ? (
-
setNewLinkModal(false)} />
- ) : undefined}
- {newCollectionModal ? (
- setNewCollectionModal(false)} />
- ) : undefined}
- {uploadFileModal ? (
- setUploadFileModal(false)} />
- ) : undefined}
- >
- );
-}