UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 632 B
import{jsx as r}from"react/jsx-runtime";import{useObserver as t}from"mobx-react-lite";import{useCallback as s}from"react";import{searchStore as a,uiState as e}from"../store";import n from"../ui/MobileToggleButton";import{t as o}from"../utils/i18n";function m(){const l=s(()=>{e.isOverlayOpen&&e.overlaySize==="full"?e.desiredOverlaySize="small":a.openOverlayWithoutInputFocus()},[]);return t(()=>{if(!e.shouldShowMobileToggle)return null;const i=e.mobileToggleIsListMode;return r(n,{mode:i?"list":"map",label:i?o("List"):o("Map"),ariaLabel:i?o("Show list"):o("Show map"),withBanner:e.isBannerVisible,onClick:l})})}export default m;