import React, { FunctionComponent } from 'react' // import styled from '@emotion/styled' import { LinkIcon } from '@heroicons/react/outline' import useMangoStore from '../stores/useMangoStore' import { MoveIcon } from './icons' import EmptyState from './EmptyState' import { useTranslation } from 'next-i18next' // const StyledDragWrapperContent = styled.div` // transition: all 0.25s ease-in; // opacity: 0; // ` // const StyledDragBkg = styled.div` // transition: all 0.25s ease-in; // opacity: 0; // ` // const StyledDragWrapper = styled.div` // :hover { // ${StyledDragWrapperContent} { // opacity: 1; // } // ${StyledDragBkg} { // opacity: 0.9; // } // } // ` interface FloatingElementProps { className?: string showConnect?: boolean } const FloatingElement: FunctionComponent = ({ className, children, showConnect, }) => { const { t } = useTranslation('common') const { uiLocked } = useMangoStore((s) => s.settings) const connected = useMangoStore((s) => s.wallet.connected) const wallet = useMangoStore((s) => s.wallet.current) return (
{!connected && showConnect ? (
} onClickButton={() => (wallet ? wallet.connect() : null)} title={t('connect-wallet')} />
) : null} {!uiLocked ? (
{t('reposition')}
) : null} {children}
) } export default FloatingElement