@mojito-inc/secondary-market
Version:
Mojito secondary market is the platform to purchase NFT.
2 lines (1 loc) • 2.8 kB
JavaScript
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useMemo as i,useCallback as n}from"react";import l from"@mui/material/Stack";import r from"@mui/material/Select";import a from"@mui/material/MenuItem";import d from"@mui/material/Typography";import p from"@mui/material/Box";import{useTheme as u}from"@mui/material/styles";import m from"@mui/icons-material/ImportExport";import s from"@mui/icons-material/KeyboardArrowDown";const x=({selectedValue:x,title:c,menu:f,onChangeValue:g,isMakeOfferModal:h})=>{var v,b,y;const I=u(),[C,k]=t(!1),w=i((()=>{var e,o;return{borderBottom:`1px solid ${null===(o=null===(e=null==I?void 0:I.palette)||void 0===e?void 0:e.grey)||void 0===o?void 0:o[400]}`}}),[null===(v=null==I?void 0:I.palette)||void 0===v?void 0:v.grey]),O=i((()=>({padding:"10px"})),[]),M=n((()=>{k(!C)}),[C]);return e(l,{sx:{border:"none",maxHeight:"75px",borderRadius:"5px",overflow:"hidden",backgroundColor:h?"none":null===(y=null===(b=I.palette.appDefaultColor)||void 0===b?void 0:b.secondary)||void 0===y?void 0:y.light,position:"relative",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:h?"start":"center"},children:[o(p,{onClick:M,sx:{position:"absolute",zIndex:1,right:"10px",display:{xl:"flex",xs:"none"},cursor:"pointer",height:"100%",justifyContent:"center",alignItems:"center"},children:o(s,{sx:{fontSize:"16px"}})}),c&&o(d,{sx:{paddingTop:"15px",paddingLeft:"10px",fontSize:"10px",fontWeight:"500"},children:c}),o(r,{"data-testid":"default-dropdown",sx:{background:"transparent",width:"100%",border:"none",maxHeight:h?"auto":"40px",boxShadow:"none",".MuiOutlinedInput-notchedOutline":{border:0},"&.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{border:0},"&.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{border:0},svg:"none",marginTop:h?"-10px":"0px"},onClick:M,open:C,onClose:()=>k(!1),inputProps:{IconComponent:()=>null},value:x,renderValue:t=>{var i,n;return e(p,{sx:{display:"flex",gap:1,fontSize:"14px",alignItems:"center",height:h?"15px":"34px",justifyContent:"center",width:"100%"},children:[o(m,{sx:{display:h?"none":"block",color:"white",fontSize:"16px",position:"relative",zIndex:1,paddingLeft:{xl:"0px",xs:"12px"}}}),o(d,{sx:{fontWeight:700,textAlign:h?"left":"center",color:null===(n=null===(i=I.palette)||void 0===i?void 0:i.text)||void 0===n?void 0:n.primary,marginTop:h?"10px":"0px",display:{xl:"block",xs:h?"block":"none",fontSize:"14px",width:"100%"}},children:t})]})},onChange:g,children:null==f?void 0:f.map(((e,t)=>o(a,{value:null==e?void 0:e.label,sx:t!==f.length-1?Object.assign({borderBottom:w},O):O,style:{margin:"-7px 0",backgroundColor:(null==e?void 0:e.label)===x?"#3AB8B0":""},children:null==e?void 0:e.label},null==e?void 0:e.label)))})]})};export{x as default};