diff --git a/components/SearchEventsListener.tsx b/components/SearchEventsListener.tsx index b5d05b3..556f28b 100644 --- a/components/SearchEventsListener.tsx +++ b/components/SearchEventsListener.tsx @@ -39,6 +39,7 @@ const SearchEventsListener: FC = () => { start_min: startMinParam, start_max: startMaxParam, end_min: endMinParam, + orgTag: orgTagParam, } = query const { slug } = query @@ -84,7 +85,8 @@ const SearchEventsListener: FC = () => { limit = limit !== 0 ? limit : undefined const typeNames = getTypeNamesFromRouterOrKnownCategoryNamesIfEmpty(router) - + + const orgTag: string = convertQueryParamToString(orgTagParam) const fixedTags: string[] = convertQueryParamToArray(fixedTagsParam) const tags: string[] = convertQueryParamToArray(tagsParam) const compoundTags = [...fixedTags, ...tags] @@ -101,6 +103,11 @@ const SearchEventsListener: FC = () => { categories: toString(entryCategories), limit: limit, } + + if (orgTag !== '') { + searchEntriesRequestDTO.org_tag = orgTag + } + dispatch(fetchEntries(searchEntriesRequestDTO)) } else { dispatch(emptyEntries()) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 170a94c..fbad994 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -1,23 +1,27 @@ -import {FC, useEffect, useState} from 'react' +import {FC, useEffect, useState, useMemo } from 'react' +import dynamic from 'next/dynamic' import {useRouter} from 'next/router' -import {Drawer} from 'antd' -import { LeftOutlined } from '@ant-design/icons' +import { Drawer } from 'antd' import SidebarContent from './SidebarContent' +import SidebarCollapseButton from './SidebarCollapseButton' import {convertQueryParamToString} from '../utils/utils' import {isSidebarStatusShown} from '../dtos/SidebarStatus' import {useSidebar} from '../hooks/useResponsive' import { closeSidebar } from './SidebarCollapseButton' - interface SidebarProps { title: String } const Sidebar: FC = (props) => { - const { title } = props - + const ClientDrawer = useMemo(() => dynamic( + () => Promise.resolve(Drawer), + { + ssr: false, + }, + ), []) const router = useRouter() const { @@ -37,10 +41,11 @@ const Sidebar: FC = (props) => { }, [shouldOpenSidebar]) return ( - } placement="left" mask={false} rootStyle={{ @@ -49,7 +54,6 @@ const Sidebar: FC = (props) => { display: 'flex', overflowX: 'clip', overflowY: 'scroll', - position: 'absolute', }} getContainer={false} width={isSidebarOpen ? sidebarWidth : 0} @@ -57,17 +61,16 @@ const Sidebar: FC = (props) => { body: { padding: 0 }, - header: { - padding: 6, + wrapper: { + display: 'block' } }} - title={title} - onClose={() => closeSidebar(router)} > + {isSidebarOpen && ( )} - + ) } diff --git a/components/SidebarCollapseButton.tsx b/components/SidebarCollapseButton.tsx index 94696b9..85b8e67 100644 --- a/components/SidebarCollapseButton.tsx +++ b/components/SidebarCollapseButton.tsx @@ -76,23 +76,33 @@ const SidebarCollapseButtonIcon: FC = (props) => { return } -const SidebarCollapseButton: FC = () => { +interface SidebarCollapseButtonProps { + isOnMap?: boolean +} + +const SidebarCollapseButton: FC = (props) => { + const {isOnMap} = props + const router = useRouter() + const { query } = router + const { sidebar: sidebarParam } = query + const isSidebarOpen = isSidebarStatusShown(convertQueryParamToString(sidebarParam)) return (