@mojito-inc/secondary-market
Version:
Mojito secondary market is the platform to purchase NFT.
2 lines (1 loc) • 2.79 kB
JavaScript
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useMemo as o,useCallback as n}from"react";import l from"@mui/material/Stack";import r from"@mui/material/Modal";import t from"@mui/material/Menu";import a from"@mui/material/MenuItem";import d from"@mui/material/Box";import{useTheme as p}from"@mui/material/styles";import m from"@mui/icons-material/Close";import u from"@mui/material/Tooltip";const c=({isMobileScreen:c,anchorEl:s,menuOptions:x,copied:h,handleMenuClose:g})=>{var v,f;const b=p(),k=o((()=>({position:"absolute",bottom:"0",width:"100%",bgcolor:b.palette.background.paper,overflowY:"auto",height:"auto",maxHeight:"100%",paddingBottom:"40px"})),[b]),w=o((()=>null==x?void 0:x.filter((e=>!e.hideMenu))),[x]),y=n((()=>w.map(((o,n)=>{var r,t,p,m;return e(a,{"data-testid":"menuContainer-id",disabled:null==o?void 0:o.hideMenu,onClick:null==o?void 0:o.menuAction,sx:c?{padding:"8px 40px",display:"flex",flexDirection:"column",gap:"16px",alignSelf:"stretch"}:{fontSize:"14px",padding:"8px 16px",width:"175px",whiteSpace:"unset",wordBreak:"break-word",boxShadow:0===n?"none":`0px -1px 0px 0px ${null===(t=null===(r=b.palette)||void 0===r?void 0:r.border)||void 0===t?void 0:t.dark}`},children:c?e(l,{sx:{justifyContent:"center",alignItems:"center",alignSelf:"stretch",height:"40px",borderRadius:"4px",border:`1px solid ${null===(m=null===(p=null==b?void 0:b.palette)||void 0===p?void 0:p.border)||void 0===m?void 0:m.dark}`},children:e(d,{sx:{lineHeight:"normal",fontWeight:700,gap:"8px",flexShrink:0,padding:"10px 11px"},children:e(u,{placement:"top-start",title:"Link copied!",open:"Copy Link"===(null==o?void 0:o.menuName)&&""!==h&&"close"!==h,children:i(d,{sx:{display:"flex",alignItems:"center"},children:[null==o?void 0:o.menuIcon,null==o?void 0:o.menuName]})})})}):e(u,{placement:"right-end",title:"Link copied!",open:"Copy Link"===(null==o?void 0:o.menuName)&&""!==h&&"close"!==h,children:i(d,{sx:{display:"flex",alignItems:"center"},children:[null==o?void 0:o.menuIcon,null==o?void 0:o.menuName]})})},o.menuName)}))),[c,w,b,h]);return e(d,{children:c?e(r,{open:Boolean(s),children:i(d,{sx:Object.assign(Object.assign({},k),{borderRadius:"6px"}),children:[e(d,{sx:{position:"fixed",height:"24px",paddingTop:"12px",right:"20px"},children:e(m,{sx:{cursor:"pointer",color:b.palette.background.default},onClick:g})}),e(d,{marginTop:"48px",children:y()})]})}):e(t,{id:"media-menu",anchorEl:s,open:Boolean(s),PaperProps:{style:{boxShadow:"none",border:`1px solid ${null===(f=null===(v=null==b?void 0:b.palette)||void 0===v?void 0:v.border)||void 0===f?void 0:f.dark}`}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{width:"200px",fontFamily:"sneak",borderRadius:"4px"},onClose:g,children:y()})})};export{c as default};