{ "version": 3, "sources": ["../../assets/scripts/store/features/navigation/SidebarMobile/index.tsx", "../../assets/scripts/store/features/navigation/SidebarMobile/DefaultScreen.tsx", "../../assets/scripts/store/features/navigation/SidebarMobile/NavigationAnchor.tsx", "../../assets/scripts/store/features/navigation/SidebarMobile/CategoryGridItem.tsx"], "sourcesContent": ["import breakpoints from '@configs/breakpoints';\r\nimport useComponentVisible from '@store/hooks/useComponentVisible';\r\nimport { useEffect, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport DefaultScreen from './DefaultScreen';\r\nimport type { ICurrencyItem, INavigationItem } from './types';\r\n\r\nexport interface SidebarMobileProps {\r\n items: INavigationItem[];\r\n currencies: ICurrencyItem[];\r\n}\r\n\r\nexport default function SidebarMobile({ items, currencies }: SidebarMobileProps) {\r\n const { t } = useTranslation();\r\n\r\n const [isCorrectBreakpoint, setIsCorrectBreakpoint] = useState(false);\r\n const { ref, isComponentVisible, setIsComponentVisible } = useComponentVisible(false);\r\n\r\n function handler() {\r\n const mediaQueryList = window.matchMedia(`(min-width: ${breakpoints.laptop}px)`);\r\n setIsCorrectBreakpoint(!mediaQueryList.matches);\r\n }\r\n\r\n useEffect(() => {\r\n handler();\r\n window.addEventListener('resize', handler, false);\r\n return () => window.removeEventListener('resize', handler);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!isCorrectBreakpoint) return;\r\n\r\n const app = document.getElementById('app')!;\r\n app.classList.add('ease-in-out', 'duration-300', 'transition-transform');\r\n if (isComponentVisible) {\r\n app.classList.add('translate-x-[320px]');\r\n app.classList.remove('translate-x-0');\r\n } else {\r\n app.classList.add('translate-x-0');\r\n app.classList.remove('translate-x-[320px]');\r\n }\r\n }, [isComponentVisible, isCorrectBreakpoint]);\r\n\r\n if (!isCorrectBreakpoint) return <>;\r\n return (\r\n
\r\n setIsComponentVisible(true)}>\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n
\r\n {isComponentVisible && (\r\n setIsComponentVisible(false)}\r\n />\r\n )}\r\n
\r\n
\r\n );\r\n}\r\n", "import fetcher from '@app/utils/fetcher';\r\nimport useConfiguration from '@store/hooks/useConfiguration';\r\nimport type { MutableRefObject} from 'react';\r\nimport React, { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport useSWR from 'swr';\r\n\r\nimport CategoryGridItem from './CategoryGridItem';\r\nimport NavigationAnchor from './NavigationAnchor';\r\nimport type { ICategoryNode, ICurrencyItem, INavigationItem, SidebarApiResponse } from './types';\r\n\r\ninterface IProps {\r\n navigationItems: INavigationItem[];\r\n currencies: ICurrencyItem[];\r\n divRef: MutableRefObject;\r\n onClose: () => void;\r\n}\r\n\r\nexport default function DefaultScreen(props: IProps) {\r\n const { t } = useTranslation();\r\n const { culture } = useConfiguration();\r\n\r\n const [selectedNode, setSelectedNode] = useState();\r\n\r\n const { data, error } = useSWR(`/${culture}/catalog/category-tree`, fetcher, {\r\n revalidateOnFocus: false,\r\n });\r\n\r\n const onClose = () => {\r\n setSelectedNode(undefined);\r\n props.onClose();\r\n };\r\n\r\n if (error) return
Chyba {error}
;\r\n if (!data) return <>;\r\n\r\n return (\r\n \r\n
\r\n {t('Menu')}\r\n {props.currencies.length > 1 && (\r\n <>\r\n
\r\n {props.currencies.map(item => (\r\n \r\n {item.code}\r\n \r\n ))}\r\n
\r\n \r\n )}\r\n \r\n
\r\n \r\n {data.map(node => (\r\n setSelectedNode(n)}\r\n onBack={() => setSelectedNode(undefined)}\r\n selectedNodeId={selectedNode?.categoryId}\r\n {...node}\r\n />\r\n ))}\r\n\r\n {props.navigationItems.length > 0 && (\r\n <>\r\n
\r\n Ostatn\u00E9 str\u00E1nky\r\n
\r\n {props.navigationItems.map(item => (\r\n
\r\n \r\n {item.title}\r\n \r\n
\r\n ))}\r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n", "import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';\r\nimport React from 'react';\r\n\r\ninterface IProps extends AnchorHTMLAttributes {\r\n href: string;\r\n title: string;\r\n}\r\n\r\n// function IconWrapper({ children }: PropsWithChildren) {\r\n// return {children};\r\n// }\r\n\r\nexport default function NavigationAnchor({\r\n children,\r\n className,\r\n ...aProps\r\n}: PropsWithChildren) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n", "import type { FC, PropsWithChildren } from 'react';\r\nimport React from 'react';\r\n\r\nimport NavigationAnchor from './NavigationAnchor';\r\nimport type { ICategoryNode } from './types';\r\n\r\ninterface IProps extends ICategoryNode {\r\n onClick: (node: ICategoryNode) => void;\r\n onBack: () => void;\r\n selectedNodeId?: string;\r\n}\r\n\r\nconst Wrapper: FC> = ({ children }) => (\r\n
{children}
\r\n);\r\n\r\nexport default function CategoryGridItem({ onClick, onBack, selectedNodeId, ...node }: IProps) {\r\n return (\r\n \r\n
\r\n {\r\n if (node.nodes.length > 0) {\r\n e.preventDefault();\r\n onClick(node);\r\n }\r\n }}>\r\n {node.categoryName}\r\n \r\n\r\n {node.nodes.length > 0 && (\r\n onClick(node)}\r\n className={`inline-flex items-center justify-center ml-auto text-primary px-4 py-2`}\r\n type=\"button\">\r\n \r\n \r\n )}\r\n
\r\n\r\n {node.nodes.length > 0 && (\r\n \r\n {selectedNodeId && (\r\n \r\n Na hlavn\u00E9 kateg\u00F3rie\r\n \r\n \r\n )}\r\n
\r\n {node.nodes.map(node => (\r\n \r\n \r\n {node.categoryName}\r\n \r\n \r\n ))}\r\n
\r\n \r\n )}\r\n
\r\n );\r\n}\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,gBAAoC;;;ACCpC,mBAAgC;;;ACe5B;AANW,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA8B;AAC5B,SACE,4CAAC,OAAG,GAAG,QAAQ,WAAW,+CAA+C,SAAS,IAC/E,UACH;AAEJ;;;ACTE,IAAAC,sBAAA;AADF,IAAM,UAA0C,CAAC,EAAE,SAAS,MAC1D,6CAA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