diff --git a/.prettierignore b/.prettierignore index a247dada0..7cbe7657f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,3 +3,5 @@ dist public/lib stats.html pnpm-lock.yaml +android +ios diff --git a/src/app.tsx b/src/app.tsx index af81d1f22..f77a53036 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,6 +1,6 @@ import { lazy, Suspense } from "react"; import { Spinner } from "@chakra-ui/react"; -import { createBrowserRouter, Outlet, RouterProvider, ScrollRestoration } from "react-router"; +import { createBrowserRouter, Outlet, RouterProvider, ScrollRestoration, Location } from "react-router"; import GlobalStyles from "./styles"; @@ -12,16 +12,14 @@ import useSetColorMode from "./hooks/use-set-color-mode"; import TaskManagerProvider from "./views/task-manager/provider"; -/* - TODO: update scroll restoration to use a different key then location.key - the location.key changes when location.state changes, but that should not change the scroll position -*/ +const getScrollKey = (location: Location) => location.pathname + location.search + location.hash; + const RootPage = () => { useSetColorMode(); return ( - + ); @@ -29,7 +27,7 @@ const RootPage = () => { const NoLayoutPage = () => { return ( - + }> diff --git a/src/components/dashboard/panel-item-toggle.tsx b/src/components/dashboard/panel-item-toggle.tsx index d8b2fd39e..fa0efeecd 100644 --- a/src/components/dashboard/panel-item-toggle.tsx +++ b/src/components/dashboard/panel-item-toggle.tsx @@ -1,19 +1,19 @@ -import { FormControl, FormControlProps, FormLabel, Switch } from '@chakra-ui/react'; +import { FormControl, FormControlProps, FormLabel, Switch } from "@chakra-ui/react"; export default function PanelItemToggle({ - label, - value, - onChange, - ...props -}: Omit & { - label?: string; - value: boolean; - onChange: () => void; + label, + value, + onChange, + ...props +}: Omit & { + label?: string; + value: boolean; + onChange: () => void; }) { - return ( - - {label} - - - ); + return ( + + {label} + + + ); } diff --git a/src/components/dashboard/panel.tsx b/src/components/dashboard/panel.tsx index 71800c3af..7523cd1fc 100644 --- a/src/components/dashboard/panel.tsx +++ b/src/components/dashboard/panel.tsx @@ -1,19 +1,19 @@ -import { useState } from 'react'; -import { Flex, FlexProps, Heading } from '@chakra-ui/react'; -import TextButton from './text-button'; +import { useState } from "react"; +import { Flex, FlexProps, Heading } from "@chakra-ui/react"; +import TextButton from "./text-button"; export default function Panel({ label, children, ...props }: FlexProps & { label?: string }) { - const [open, setOpen] = useState(true); + const [open, setOpen] = useState(true); - return ( - - - {label} - setOpen(!open)} type="button"> - [{open ? '-' : '+'}] - - - {open && children} - - ); + return ( + + + {label} + setOpen(!open)} type="button"> + [{open ? "-" : "+"}] + + + {open && children} + + ); } diff --git a/src/components/dashboard/text-button.tsx b/src/components/dashboard/text-button.tsx index 3d7c0aff5..c2a672bcf 100644 --- a/src/components/dashboard/text-button.tsx +++ b/src/components/dashboard/text-button.tsx @@ -1,9 +1,9 @@ -import { Button, ButtonProps } from '@chakra-ui/react'; +import { Button, ButtonProps } from "@chakra-ui/react"; export default function TextButton({ children, ...props }: ButtonProps) { - return ( - - ); + return ( + + ); } diff --git a/src/components/layout/index.tsx b/src/components/layout/index.tsx index 376900261..9d98ba016 100644 --- a/src/components/layout/index.tsx +++ b/src/components/layout/index.tsx @@ -1,10 +1,10 @@ -import MobileLayout from './mobile'; -import DesktopLayout from './desktop'; -import { useBreakpointValue } from '../../providers/global/breakpoint-provider'; +import MobileLayout from "./mobile"; +import DesktopLayout from "./desktop"; +import { useBreakpointValue } from "../../providers/global/breakpoint-provider"; export default function AppLayout() { - const mobile = useBreakpointValue({ base: true, md: false }); + const mobile = useBreakpointValue({ base: true, md: false }); - if (mobile) return ; - else return ; + if (mobile) return ; + else return ; } diff --git a/src/hooks/reports/use-network-status-report.ts b/src/hooks/reports/use-network-status-report.ts index 966068fa6..cde1ea8a0 100644 --- a/src/hooks/reports/use-network-status-report.ts +++ b/src/hooks/reports/use-network-status-report.ts @@ -1,9 +1,9 @@ -import { useObservable } from 'applesauce-react/hooks'; +import { useObservable } from "applesauce-react/hooks"; -import useReport from '../use-report'; +import useReport from "../use-report"; export default function useNetworkOverviewReport() { - const report = useReport('NETWORK_STATUS', 'network-status', {}); + const report = useReport("NETWORK_STATUS", "network-status", {}); - return useObservable(report?.status); + return useObservable(report?.status); } diff --git a/src/hooks/use-user-bookmarks-list.ts b/src/hooks/use-user-bookmarks-list.ts index a2b32831e..b139a9e08 100644 --- a/src/hooks/use-user-bookmarks-list.ts +++ b/src/hooks/use-user-bookmarks-list.ts @@ -5,7 +5,7 @@ import { getAddressPointersFromList, getEventPointersFromList } from "applesauce import useCurrentAccount from "./use-current-account"; import useReplaceableEvent from "./use-replaceable-event"; -export default function userUserBookmarksList(pubkey?: string, relays: string[] = [], force=false) { +export default function userUserBookmarksList(pubkey?: string, relays: string[] = [], force = false) { const account = useCurrentAccount(); const key = pubkey ?? account?.pubkey;