diff --git a/components/FloatingElement.tsx b/components/FloatingElement.tsx index 19728a52..981d8bcb 100644 --- a/components/FloatingElement.tsx +++ b/components/FloatingElement.tsx @@ -1,18 +1,47 @@ -import React, { FunctionComponent } from 'react' +import React from 'react' +import styled from '@emotion/styled' +import useMangoStore from '../stores/useMangoStore' +import { MoveIcon } from './icons' -type FloatingElementProps = { - className?: string -} +const StyledDragWrapperContent = styled.div` + transition: all 0.25s ease-in; + opacity: 0; +` -const FloatingElement: FunctionComponent = ({ - className, - children, -}) => { +const StyledDragBkg = styled.div` + transition: all 0.25s ease-in; + opacity: 0; +` + +const StyledDragWrapper = styled.div` + :hover { + ${StyledDragWrapperContent} { + opacity: 1; + } + ${StyledDragBkg} { + opacity: 0.9; + } + } +` + +export default function FloatingElement({ shrink = false, children }) { + const { uiLocked } = useMangoStore((s) => s.settings) return (
-
{children}
+ {!uiLocked ? ( + + + +
Drag to reposition
+
+ +
+ ) : null} + {children}
) } diff --git a/components/ThemeSwitch.jsx b/components/ThemeSwitch.jsx index e90d8125..c5b5f923 100644 --- a/components/ThemeSwitch.jsx +++ b/components/ThemeSwitch.jsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { useTheme } from 'next-themes' import { MoonIcon, SunIcon } from '@heroicons/react/outline' import DropMenu from './DropMenu' -import MangoIcon from './MangoIcon' +import { MangoIcon } from './icons' const THEMES = [ { name: 'Light', icon: }, diff --git a/components/TopBar.tsx b/components/TopBar.tsx index 6b3124c0..bcb81db8 100644 --- a/components/TopBar.tsx +++ b/components/TopBar.tsx @@ -11,7 +11,7 @@ import { } from '@heroicons/react/outline' import MenuItem from './MenuItem' import ThemeSwitch from './ThemeSwitch' -import WalletIcon from './WalletIcon' +import { WalletIcon } from './icons' import UiLock from './UiLock' import { useRouter } from 'next/router' import WalletSelect from './WalletSelect' @@ -26,6 +26,10 @@ const Code = styled.code` font-size: 13px; ` +const StyledWalletTypeLabel = styled.div` + font-size: 0.6rem; +` + const TopBar = () => { const { asPath } = useRouter() const connected = useMangoStore((s) => s.wallet.connected) @@ -70,7 +74,7 @@ const TopBar = () => { ] return ( -