diff --git a/components/Button.tsx b/components/Button.tsx index a1d87e9..46d036b 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -17,7 +17,7 @@ const Button: FunctionComponent = ({ + )} {showDeposit && ( diff --git a/components/Input.tsx b/components/Input.tsx index 7fbfbfb..abb5f79 100644 --- a/components/Input.tsx +++ b/components/Input.tsx @@ -24,7 +24,7 @@ const Input = ({ } ${className}`} > {prefix ? ( -
+
{prefix}
) : null} @@ -33,7 +33,7 @@ const Input = ({ type={type} value={value} onChange={onChange} - className={`bg-transparent w-full font-light focus:outline-none ${ + className={`bg-transparent w-full focus:outline-none ${ disabled && 'opacity-20 cursor-not-allowed' } ${type === 'number' ? 'text-right' : ''}`} disabled={disabled} diff --git a/components/MangoIcon.jsx b/components/MangoIcon.jsx new file mode 100644 index 0000000..3326118 --- /dev/null +++ b/components/MangoIcon.jsx @@ -0,0 +1,29 @@ +const MangoIcon = ({ className }) => { + return ( + + + + + ) +} + +export default MangoIcon diff --git a/components/MarginBalances.tsx b/components/MarginBalances.tsx index 61bdea0..d09cdff 100644 --- a/components/MarginBalances.tsx +++ b/components/MarginBalances.tsx @@ -58,16 +58,16 @@ export default function MarginStats() { - - - - @@ -104,7 +104,7 @@ export default function MarginStats() { +{(selectedMangoGroup.getDepositRate(i) * 100).toFixed(2)} % - {' / '} + {' / '} -{(selectedMangoGroup.getBorrowRate(i) * 100).toFixed(2)}% @@ -114,24 +114,21 @@ export default function MarginStats() {
+ Assets + Deposits + Borrows + Interest (APY)
) : null} -
-
- -
-
- -
+
+ +
Settle funds in the Balances tab diff --git a/components/MarginStats.tsx b/components/MarginStats.tsx index 5066143..a95852c 100644 --- a/components/MarginStats.tsx +++ b/components/MarginStats.tsx @@ -156,7 +156,7 @@ export default function MarginStats() { {entry.label}
-
+
{entry.currency + entry.value} {entry.unit}
diff --git a/components/MenuItem.tsx b/components/MenuItem.tsx index fc08e9f..584e254 100644 --- a/components/MenuItem.tsx +++ b/components/MenuItem.tsx @@ -8,7 +8,7 @@ const MenuItem = ({ href, children }) => { ` text-align: ${(props) => (props.invert ? 'left' : 'right')}; float: ${(props) => (props.invert ? 'left' : 'right')}; height: 100%; - filter: opacity(70%); + filter: opacity(80%); ${(props) => props['data-width'] && `width: ${props['data-width']};`} ` @@ -156,7 +156,7 @@ const OrderbookRow = React.memo( return (
diff --git a/components/RecentMarketTrades.tsx b/components/RecentMarketTrades.tsx index d99e357..43e39cf 100644 --- a/components/RecentMarketTrades.tsx +++ b/components/RecentMarketTrades.tsx @@ -34,7 +34,7 @@ export default function PublicTrades() { return ( - Recent Market Trades + Recent Trades
Price ({quoteCurrency})
Size ({baseCurrency})
@@ -43,11 +43,11 @@ export default function PublicTrades() { {!!trades.length && (
{trades.map((trade: ChartTradeType, i: number) => ( -
+
{market?.tickSize && !isNaN(trade.price) ? Number(trade.price).toFixed( diff --git a/components/Select.jsx b/components/Select.jsx new file mode 100644 index 0000000..bf94766 --- /dev/null +++ b/components/Select.jsx @@ -0,0 +1,51 @@ +import { Listbox } from '@headlessui/react' +import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/solid' + +const Select = ({ value, onChange, options, className = '' }) => { + return ( +
+ + {({ open }) => ( + <> + +
+ {value} + {open ? ( + + ) : ( + + )} +
+
+ {open ? ( + + {options.map((option) => ( + + {({ selected }) => ( +
+ {option} +
+ )} +
+ ))} +
+ ) : null} + + )} +
+
+ ) +} + +export default Select diff --git a/components/Switch.tsx b/components/Switch.tsx index c838983..d603af9 100644 --- a/components/Switch.tsx +++ b/components/Switch.tsx @@ -22,7 +22,7 @@ const Switch: FunctionComponent = ({ ) : ( ) ) : ( diff --git a/components/TradeType.jsx b/components/TradeType.jsx index 60e619a..a1c7c59 100644 --- a/components/TradeType.jsx +++ b/components/TradeType.jsx @@ -10,29 +10,29 @@ const TradeType = ({ value, onChange, className = '' }) => { {({ open }) => ( <>
{value} {open ? ( - + ) : ( - + )}
{open ? ( {TRADE_TYPES.map((type) => ( {({ selected }) => (
diff --git a/components/TradingView/index.tsx b/components/TradingView/index.tsx index 5d93b1e..f9c0a55 100755 --- a/components/TradingView/index.tsx +++ b/components/TradingView/index.tsx @@ -34,13 +34,6 @@ export interface ChartContainerProps { const TVChartContainer = () => { const selectedMarketName = useMangoStore((s) => s.selectedMarket.name) const { theme } = useTheme() - const [currentTheme, setCurrentTheme] = useState(theme) - - console.log(currentTheme) - - useEffect(() => { - setCurrentTheme(theme) - }, [theme]) // @ts-ignore const defaultProps: ChartContainerProps = { @@ -53,8 +46,8 @@ const TVChartContainer = () => { fullscreen: false, autosize: true, studiesOverrides: { - 'volume.volume.color.0': '#E54033', - 'volume.volume.color.1': '#AFD803', + 'volume.volume.color.0': theme === 'Mango' ? '#E54033' : '#CC2929', + 'volume.volume.color.1': theme === 'Mango' ? '#AFD803' : '#5EBF4D', }, } @@ -102,19 +95,26 @@ const TVChartContainer = () => { fullscreen: defaultProps.fullscreen, autosize: defaultProps.autosize, studies_overrides: defaultProps.studiesOverrides, - theme: theme === 'light' ? 'Light' : 'Dark', + theme: theme === 'Light' ? 'Light' : 'Dark', overrides: { 'paneProperties.background': - theme === 'dark' ? '#0F282D' : theme === 'light' ? '#fff' : '#1D1832', - 'mainSeriesProperties.candleStyle.upColor': '#AFD803', - 'mainSeriesProperties.candleStyle.downColor': '#E54033', + theme === 'Dark' ? '#2B2B2B' : theme === 'Light' ? '#fff' : '#1D1832', + 'mainSeriesProperties.candleStyle.upColor': + theme === 'Mango' ? '#AFD803' : '#5EBF4D', + 'mainSeriesProperties.candleStyle.downColor': + theme === 'Mango' ? '#E54033' : '#CC2929', 'mainSeriesProperties.candleStyle.drawWick': true, 'mainSeriesProperties.candleStyle.drawBorder': true, - 'mainSeriesProperties.candleStyle.borderColor': '#AFD803', - 'mainSeriesProperties.candleStyle.borderUpColor': '#AFD803', - 'mainSeriesProperties.candleStyle.borderDownColor': '#E54033', - 'mainSeriesProperties.candleStyle.wickUpColor': '#AFD803', - 'mainSeriesProperties.candleStyle.wickDownColor': '#E54033', + 'mainSeriesProperties.candleStyle.borderColor': + theme === 'Mango' ? '#AFD803' : '#5EBF4D', + 'mainSeriesProperties.candleStyle.borderUpColor': + theme === 'Mango' ? '#AFD803' : '#5EBF4D', + 'mainSeriesProperties.candleStyle.borderDownColor': + theme === 'Mango' ? '#E54033' : '#CC2929', + 'mainSeriesProperties.candleStyle.wickUpColor': + theme === 'Mango' ? '#AFD803' : '#5EBF4D', + 'mainSeriesProperties.candleStyle.wickDownColor': + theme === 'Mango' ? '#E54033' : '#CC2929', }, } diff --git a/pages/index.tsx b/pages/index.tsx index 43d7884..2da18fc 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -8,7 +8,7 @@ const Index = () => { useHydrateStore() return ( -
+
diff --git a/styles/global.css b/styles/global.css deleted file mode 100644 index 16d50fe..0000000 --- a/styles/global.css +++ /dev/null @@ -1,39 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -:root { - --primary: theme('colors.light-theme.orange'); - --red: theme('colors.light-theme.red'); - --green: theme('colors.light-theme.green'); - --bkg-1: theme('colors.light-theme["bkg-1"]'); - --bkg-2: theme('colors.light-theme["bkg-2"]'); - --bkg-3: theme('colors.light-theme["bkg-3"]'); - --fgd-1: theme('colors.light-theme["fgd-1"]'); - --fgd-2: theme('colors.light-theme["fgd-2"]'); - --fgd-3: theme('colors.light-theme["fgd-3"]'); -} - -[data-theme='dark'] { - --primary: theme('colors.dark-theme.orange'); - --red: theme('colors.dark-theme.red'); - --green: theme('colors.dark-theme.green'); - --bkg-1: theme('colors.dark-theme["bkg-1"]'); - --bkg-2: theme('colors.dark-theme["bkg-2"]'); - --bkg-3: theme('colors.dark-theme["bkg-3"]'); - --fgd-1: theme('colors.dark-theme["fgd-1"]'); - --fgd-2: theme('colors.dark-theme["fgd-2"]'); - --fgd-3: theme('colors.dark-theme["fgd-3"]'); -} - -[data-theme='mango'] { - --primary: theme('colors.mango-theme.yellow'); - --red: theme('colors.mango-theme.red'); - --green: theme('colors.mango-theme.green'); - --bkg-1: theme('colors.mango-theme["bkg-1"]'); - --bkg-2: theme('colors.mango-theme["bkg-2"]'); - --bkg-3: theme('colors.mango-theme["bkg-3"]'); - --fgd-1: theme('colors.mango-theme["fgd-1"]'); - --fgd-2: theme('colors.mango-theme["fgd-2"]'); - --fgd-3: theme('colors.mango-theme["fgd-3"]'); -} diff --git a/styles/index.css b/styles/index.css index 7f1f2df..4883316 100644 --- a/styles/index.css +++ b/styles/index.css @@ -15,7 +15,7 @@ --fgd-4: theme('colors.light-theme["fgd-4"]'); } -[data-theme='dark'] { +[data-theme='Dark'] { --primary: theme('colors.dark-theme.orange'); --red: theme('colors.dark-theme.red'); --green: theme('colors.dark-theme.green'); @@ -28,7 +28,7 @@ --fgd-4: theme('colors.dark-theme["fgd-4"]'); } -[data-theme='mango'] { +[data-theme='Mango'] { --primary: theme('colors.mango-theme.yellow'); --red: theme('colors.mango-theme.red'); --green: theme('colors.mango-theme.green'); diff --git a/tailwind.config.js b/tailwind.config.js index 9d5ac45..cf2ca40 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -47,28 +47,28 @@ module.exports = { darkest: '#061f23', }, 'light-theme': { - orange: '#DFAB01', - red: '#E54033', - green: '#AFD803', - 'bkg-1': '#F7F7F7', + orange: '#FF9C24', + red: '#CC2929', + green: '#5EBF4D', + 'bkg-1': '#f7f7f7', 'bkg-2': '#FFFFFF', - 'bkg-3': '#E7E7E7', + 'bkg-3': '#EDEDED', 'fgd-1': '#061f23', 'fgd-2': '#0C3F45', 'fgd-3': '#446065', - 'fgd-4': '#A0AFB1', + 'fgd-4': '#B0B0B0', }, 'dark-theme': { - orange: '#DFAB01', - red: '#E54033', - green: '#AFD803', - 'bkg-1': '#061f23', - 'bkg-2': '#0F282D', - 'bkg-3': '#0F3339', + orange: '#F2C94C', + red: '#CC2929', + green: '#5EBF4D', + 'bkg-1': '#1C1C1C', + 'bkg-2': '#2B2B2B', + 'bkg-3': '#424242', 'fgd-1': '#FFFFFF', 'fgd-2': '#F7F7F7', 'fgd-3': '#E7E7E7', - 'fgd-4': '#A0AFB1', + 'fgd-4': '#878787', }, 'mango-theme': { yellow: '#F2C94C', @@ -76,7 +76,7 @@ module.exports = { green: '#AFD803', 'bkg-1': '#141026', 'bkg-2': '#1D1832', - 'bkg-3': '#262337', + 'bkg-3': '#322E47', 'fgd-1': '#F0EDFF', 'fgd-2': '#FCFCFF', 'fgd-3': '#B9B5CE',