diff --git a/.changeset/red-carrots-dream.md b/.changeset/red-carrots-dream.md new file mode 100644 index 000000000..a7535beb8 --- /dev/null +++ b/.changeset/red-carrots-dream.md @@ -0,0 +1,5 @@ +--- +"nostrudel": minor +--- + +Replace nostrchat clink with blowater diff --git a/.changeset/unlucky-keys-kneel.md b/.changeset/unlucky-keys-kneel.md new file mode 100644 index 000000000..3a36519ed --- /dev/null +++ b/.changeset/unlucky-keys-kneel.md @@ -0,0 +1,5 @@ +--- +"nostrudel": minor +--- + +Remove scroll-boxes and return to natural page scrolling diff --git a/src/app.tsx b/src/app.tsx index e5e98cbfe..a71f432ce 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -2,7 +2,7 @@ import React, { Suspense } from "react"; import { createHashRouter, Outlet, RouterProvider, ScrollRestoration } from "react-router-dom"; import { Spinner } from "@chakra-ui/react"; import { ErrorBoundary } from "./components/error-boundary"; -import { Page } from "./components/page"; +import Layout from "./components/layout"; import HomeView from "./views/home"; import SettingsView from "./views/settings"; @@ -43,12 +43,12 @@ const RootPage = () => { useSetColorMode(); return ( - + }> - + ); }; diff --git a/src/components/debug-modals/note-debug-modal.tsx b/src/components/debug-modals/note-debug-modal.tsx index 8ea43a4c5..e8dba9237 100644 --- a/src/components/debug-modals/note-debug-modal.tsx +++ b/src/components/debug-modals/note-debug-modal.tsx @@ -13,7 +13,7 @@ export default function NoteDebugModal({ event, ...props }: { event: NostrEvent - + diff --git a/src/components/debug-modals/user-debug-modal.tsx b/src/components/debug-modals/user-debug-modal.tsx index 19821c007..27c33ffb7 100644 --- a/src/components/debug-modals/user-debug-modal.tsx +++ b/src/components/debug-modals/user-debug-modal.tsx @@ -21,7 +21,7 @@ export default function UserDebugModal({ pubkey, ...props }: { pubkey: string } - + {npub && } diff --git a/src/components/embed-types/common.tsx b/src/components/embed-types/common.tsx index 8908cfd4e..859d55d73 100644 --- a/src/components/embed-types/common.tsx +++ b/src/components/embed-types/common.tsx @@ -54,7 +54,7 @@ const videoExt = [".mp4", ".mkv", ".webm", ".mov"]; export function renderVideoUrl(match: URL) { if (!videoExt.some((ext) => match.pathname.endsWith(ext))) return null; - return ); } diff --git a/src/components/layout/index.tsx b/src/components/layout/index.tsx new file mode 100644 index 000000000..5612dee19 --- /dev/null +++ b/src/components/layout/index.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import { Container, Flex } from "@chakra-ui/react"; +import { ErrorBoundary } from "../error-boundary"; + +import { useIsMobile } from "../../hooks/use-is-mobile"; +import { ReloadPrompt } from "../reload-prompt"; +import DesktopSideNav from "./desktop-side-nav"; +import MobileBottomNav from "./mobile-bottom-nav"; + +export default function Layout({ children }: { children: React.ReactNode }) { + const isMobile = useIsMobile(); + + return ( + <> + + + {!isMobile && } + + {children} + + {isMobile && ( + + )} + + + ); +} diff --git a/src/components/page/mobile-bottom-nav.tsx b/src/components/layout/mobile-bottom-nav.tsx similarity index 89% rename from src/components/page/mobile-bottom-nav.tsx rename to src/components/layout/mobile-bottom-nav.tsx index 20e24dd2f..4fcb28917 100644 --- a/src/components/page/mobile-bottom-nav.tsx +++ b/src/components/layout/mobile-bottom-nav.tsx @@ -1,4 +1,4 @@ -import { Avatar, Flex, IconButton, useDisclosure } from "@chakra-ui/react"; +import { Avatar, Flex, FlexProps, IconButton, useDisclosure } from "@chakra-ui/react"; import { useContext, useEffect } from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { useCurrentAccount } from "../../hooks/use-current-account"; @@ -7,7 +7,7 @@ import { ChatIcon, FeedIcon, HomeIcon, NotificationIcon, PlusCircleIcon, SearchI import { UserAvatar } from "../user-avatar"; import MobileSideDrawer from "./mobile-side-drawer"; -export default function MobileBottomNav() { +export default function MobileBottomNav(props: Omit) { const { isOpen, onOpen, onClose } = useDisclosure(); const { openModal } = useContext(PostModalContext); const navigate = useNavigate(); @@ -18,7 +18,7 @@ export default function MobileBottomNav() { return ( <> - + {account ? ( ) : ( diff --git a/src/components/page/mobile-side-drawer.tsx b/src/components/layout/mobile-side-drawer.tsx similarity index 100% rename from src/components/page/mobile-side-drawer.tsx rename to src/components/layout/mobile-side-drawer.tsx diff --git a/src/components/page/profile-link.tsx b/src/components/layout/profile-link.tsx similarity index 100% rename from src/components/page/profile-link.tsx rename to src/components/layout/profile-link.tsx diff --git a/src/components/page/index.tsx b/src/components/page/index.tsx deleted file mode 100644 index 131895665..000000000 --- a/src/components/page/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from "react"; -import { Container, Flex } from "@chakra-ui/react"; -import { ErrorBoundary } from "../error-boundary"; - -import { useIsMobile } from "../../hooks/use-is-mobile"; -import { ReloadPrompt } from "../reload-prompt"; -import { PostModalProvider } from "../../providers/post-modal-provider"; -import DesktopSideNav from "./desktop-side-nav"; -import MobileBottomNav from "./mobile-bottom-nav"; - -export const Page = ({ children }: { children: React.ReactNode }) => { - const isMobile = useIsMobile(); - - return ( - - - - - {!isMobile && } - - {children} - - - {isMobile && } - - - ); -}; diff --git a/src/components/reload-prompt.tsx b/src/components/reload-prompt.tsx index 864ea1136..1263ceb63 100644 --- a/src/components/reload-prompt.tsx +++ b/src/components/reload-prompt.tsx @@ -1,10 +1,10 @@ import { useRegisterSW } from "virtual:pwa-register/react"; -import { Alert, AlertIcon, AlertTitle, Button, CloseButton, useToast } from "@chakra-ui/react"; +import { Alert, AlertIcon, AlertProps, AlertTitle, Button, CloseButton, useToast } from "@chakra-ui/react"; // check for updates every hour const intervalMS = 60 * 60 * 1000; -export const ReloadPrompt = () => { +export const ReloadPrompt = (props: Omit) => { const toast = useToast(); const { needRefresh: [needRefresh, setNeedRefresh], @@ -30,7 +30,7 @@ export const ReloadPrompt = () => { }; return needRefresh ? ( - + New update ready!