@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 2.67 kB
JavaScript
import{jsx as t,jsxs as m}from"react/jsx-runtime";import"./LogoOverlay.scss";import l from"classnames";import k from"color";import{useLocalStore as M,useObserver as P}from"mobx-react-lite";import{Suspense as _}from"react";import O from"../data";import{getFpSvgJs as C}from"../data/fp-payloads";import{fpGeo as f}from"../data/fpGeo";import c,{uiState as o}from"../store";import R from"../tools/base-runtime-url";import{buildExpofpUrl as N,UTM_CAMPAIGNS as V}from"../tools/expofpUrl";import p from"../tools/settings";import{remsToPixels as a}from"../utils";import{t as r}from"../utils/i18n";import d from"../utils/is-from-designer";import A from"../utils/lazy-qr-code";import h from"./AlertContainer";const g=["info-techlive2025","metstrade-superyacht2023"].includes(p.EXPO),D=p.backgroundColor!=="none"&&k(p.backgroundColor).isDark()||f?.properties?.style?.includes("dark");export default function E(){const b=M(()=>{const s=(i,e,T,S)=>({width:S,opacity:o.wsStarted?1:0}),n=g||o.rtl?"left":"right";return{get style(){const i=a((o.overlayPosition==="left",1));if(o.overlayPosition==="left"){const e=o.mapVisibleBottom+i;return s("bottom",n,e,"5rem")}else{let e=o.mapVisibleTop;return c.maplibreStore.showMaplibre&&(e=a(.5)),s("bottom",n,20,"4.5rem")}},get warningStyle(){const i=a(o.overlayPosition==="left"?1:.5);if(o.overlayPosition==="left"){const e=o.mapVisibleBottom+2*i;return s("bottom",n,e,"3rem")}else{let e=o.mapVisibleTop+2*i;return c.maplibreStore.showMaplibre&&(e=a(.5)),s("top",n,e,"2rem")}}}}),u=Math.round(C().__fpStat?.dataSize/1024/1024||0),v=d&&u>=10,w=d&&!f&&O.allow3dView&&!o.kiosk&&!o.heatmap,y=o.kiosk&&!o.selectedRoute?.to&&!o.selectedRoute?.from,x=l("efp-qr",{"is-right":g||o.rtl});return P(()=>m("div",{children:[t("a",{href:N(V.SUBDOMAIN_LOGO),target:"_blank",rel:"noopener noreferrer",className:l("logo-overlay",{invert:D}),style:b.style,children:t("img",{src:`${R}expofp-overlay.png`,alt:r("Made with ExpoFP"),crossOrigin:"anonymous"})}),v&&t(h,{title:r("This floor plan is too big"),variant:"warning",showIcon:!0,position:"bottom-right",children:t("a",{rel:"noopener noreferrer",target:"_blank",href:"https://expofp.com/pages/huge-fp-warning",children:r("Read how to optimize it")})}),w&&t(h,{title:r("3D view is hidden"),variant:"warning",showIcon:!0,position:"bottom-right",children:t("a",{rel:"noopener noreferrer",target:"_blank",href:"https://expofp.com/pages/expofp-mapbox-integration",children:r("Setup mapbox first")})}),y&&t(_,{fallback:null,children:m("div",{className:l(x,{"efp-semi-transparent":o.setKioskModeEnabled}),children:[t("div",{children:r("View Map on Phone")}),t(A,{value:o.viewMapOnPhoneQRCodeUrl,size:100})]})})]}))}