diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index 3e43475..e6220d8 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -5,7 +5,7 @@ import { useSwipeable } from "react-swipeable"; import { useRouter } from "next/router"; import Button from "components/Button"; import { prettyLanguage } from "queries/helpers"; -import { useMediaMobile } from "hooks/useMediaQuery"; +import { useMediaCoarse, useMediaMobile } from "hooks/useMediaQuery"; import { useSelector, useDispatch } from "react-redux"; import { @@ -28,6 +28,9 @@ type AppLayoutProps = { export default function AppLayout(props: AppLayoutProps): JSX.Element { const titlePrefix = "Accord’s Library"; const router = useRouter(); + const dispatch = useDispatch(); + const isMobile = useMediaMobile(); + const isCoarse = useMediaCoarse(); const languagePanelOpen = useSelector( (state: RootState) => state.appLayout.languagePanelOpen @@ -41,10 +44,7 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element { const subPanelOpen = useSelector( (state: RootState) => state.appLayout.subPanelOpen ); - - const dispatch = useDispatch(); - - const isMobile = useMediaMobile(); + const sensibilitySwipe = 1.1; const handlers = useSwipeable({ @@ -225,7 +225,7 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element { effect="solid" delayShow={300} delayHide={100} - disable={!mainPanelReduced || isMobile} + disable={!mainPanelReduced || isMobile || isCoarse} className="drop-shadow-dark-xl !opacity-100 !bg-light !rounded-lg after:!border-r-light text-left" /> diff --git a/src/components/PanelComponents/NavOption.tsx b/src/components/PanelComponents/NavOption.tsx index b68bae6..85f709e 100644 --- a/src/components/PanelComponents/NavOption.tsx +++ b/src/components/PanelComponents/NavOption.tsx @@ -28,6 +28,7 @@ export default function NavOption(props: NavOptionProps): JSX.Element {

${props.title}

@@ -39,7 +40,6 @@ export default function NavOption(props: NavOptionProps): JSX.Element {
`} data-for={props.tooltipId} - data-multiline className={`grid grid-flow-col grid-cols-[auto] auto-cols-fr justify-center ${ props.icon ? "text-left" : "text-center" } ${divCommon}`} diff --git a/src/components/Panels/MainPanel.tsx b/src/components/Panels/MainPanel.tsx index c390b52..f223ce5 100644 --- a/src/components/Panels/MainPanel.tsx +++ b/src/components/Panels/MainPanel.tsx @@ -91,6 +91,16 @@ export default function MainPanel(props: MainPanelProps): JSX.Element { onClick={() => dispatch(setMainPanelOpen(false))} /> + dispatch(setMainPanelOpen(false))} + /> + + + - - ); - + const contentPanel = ( + +
+ {props.libraryItems.libraryItems.data.map((item) => ( + + ))} +
+
+ ); return ( ); } @@ -46,6 +61,9 @@ export default function Library(props: LibraryProps): JSX.Element { export const getStaticProps: GetStaticProps = async (context) => { if (context.locale) { const props: LibraryProps = { + libraryItems: await getLibraryItemsPreview({ + language_code: context.locale, + }), langui: await getWebsiteInterface({ language_code: context.locale, }), diff --git a/src/pages/library/items/index.tsx b/src/pages/library/items/index.tsx deleted file mode 100644 index d37a4b1..0000000 --- a/src/pages/library/items/index.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { GetStaticProps } from "next"; -import SubPanel from "components/Panels/SubPanel"; -import ContentPanel, { - ContentPanelWidthSizes, -} from "components/Panels/ContentPanel"; -import { - GetLibraryItemsPreviewQuery, - GetWebsiteInterfaceQuery, -} from "graphql/operations-types"; -import { - getLibraryItemsPreview, - getWebsiteInterface, -} from "graphql/operations"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import AppLayout from "components/AppLayout"; -import ReturnButton from "components/PanelComponents/ReturnButton"; -import HorizontalLine from "components/HorizontalLine"; -import LibraryItemsPreview from "components/Library/LibraryItemsPreview"; - -type LibraryProps = { - libraryItems: GetLibraryItemsPreviewQuery; - langui: GetWebsiteInterfaceQuery; -}; - -export default function Library(props: LibraryProps): JSX.Element { - const langui = props.langui.websiteInterfaces.data[0].attributes; - const subPanel = ( - - - - - - ); - const contentPanel = ( - -
- {props.libraryItems.libraryItems.data.map((item) => ( - - ))} -
-
- ); - return ( - - ); -} - -export const getStaticProps: GetStaticProps = async (context) => { - if (context.locale) { - const props: LibraryProps = { - libraryItems: await getLibraryItemsPreview({ - language_code: context.locale, - }), - langui: await getWebsiteInterface({ - language_code: context.locale, - }), - }; - return { - props: props, - }; - } else { - return { props: {} }; - } -};