{ "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