From 3dfea56831633b22bfcc5ae0bd47d6617dc9a354 Mon Sep 17 00:00:00 2001 From: Tyler Shipe Date: Mon, 12 Apr 2021 12:20:17 -0400 Subject: [PATCH] adding additional theme classes --- components/MarketSelect.jsx | 39 +++++++++++++++---------------- components/MenuItem.tsx | 3 ++- components/RecentMarketTrades.tsx | 2 +- components/ThemeSwitch.tsx | 12 ++++++---- components/TopBar.tsx | 14 +++++------ 5 files changed, 36 insertions(+), 34 deletions(-) diff --git a/components/MarketSelect.jsx b/components/MarketSelect.jsx index 79afcaa..f026376 100644 --- a/components/MarketSelect.jsx +++ b/components/MarketSelect.jsx @@ -6,10 +6,6 @@ import useMarketList from '../hooks/useMarketList' // import useMarket from '../hooks/useMarket' import useMangoStore from '../stores/useMangoStore' -const StyledDiv = styled.div` - cursor: pointer; -` - const MarketSelect = () => { const { spotMarkets } = useMarketList() const selectedMarket = useMangoStore((s) => s.selectedMarket) @@ -22,23 +18,26 @@ const MarketSelect = () => { } return ( -
+
{/*
Markets
*/} - {Object.entries(spotMarkets).map(([name, address]) => ( - handleChange(name)} - key={address} - > - {name} - - ))} +
+ {Object.entries(spotMarkets).map(([name, address]) => ( +
handleChange(name)} + key={address} + > + {name} +
+ ))} +
{/* {({ open }) => ( <> diff --git a/components/MenuItem.tsx b/components/MenuItem.tsx index 16c9298..8e6ca3e 100644 --- a/components/MenuItem.tsx +++ b/components/MenuItem.tsx @@ -9,7 +9,8 @@ const MenuItem = ({ href, children }) => { Recent Market Trades -
+
Price ({quoteCurrency})
Size ({baseCurrency})
Time
diff --git a/components/ThemeSwitch.tsx b/components/ThemeSwitch.tsx index 975d66c..57c98ae 100644 --- a/components/ThemeSwitch.tsx +++ b/components/ThemeSwitch.tsx @@ -2,7 +2,11 @@ import { useEffect, useState } from 'react' import xw from 'xwind' import { useTheme } from 'next-themes' -const themes = [{ name: 'light' }, { name: 'dark' }, { name: 'mango' }] +const THEMES = [ + { name: 'light', display: 'Light' }, + { name: 'dark', display: 'Dark' }, + { name: 'mango', display: 'Mango' }, +] const ThemeChanger = () => { const [mounted, setMounted] = useState(false) @@ -17,14 +21,14 @@ const ThemeChanger = () => { diff --git a/components/TopBar.tsx b/components/TopBar.tsx index b263429..8927c4e 100644 --- a/components/TopBar.tsx +++ b/components/TopBar.tsx @@ -1,8 +1,7 @@ import { useState } from 'react' import xw from 'xwind' import styled from '@emotion/styled' -// import { useTheme } from 'next-themes' -import { SunIcon, MoonIcon, MenuIcon, XIcon } from '@heroicons/react/outline' +import { MenuIcon, XIcon } from '@heroicons/react/outline' import MenuItem from './MenuItem' import useWallet from '../hooks/useWallet' import ThemeSwitch from './ThemeSwitch' @@ -16,7 +15,6 @@ const Code = styled.code` const TopBar = () => { const { connected, wallet } = useWallet() const [showMenu, setShowMenu] = useState(false) - // const { theme, setTheme } = useTheme() const handleConnectDisconnect = () => { connected ? wallet.disconnect() : wallet.connect() @@ -27,14 +25,14 @@ const TopBar = () => {
-
+
next
-
+
Trade Stats Learn @@ -88,9 +86,9 @@ const TopBar = () => { > Open main menu {showMenu ? ( - + ) : ( - + )}
@@ -101,7 +99,7 @@ const TopBar = () => { css={[showMenu ? xw`visible` : xw`hidden`, xw`sm:hidden`]} id="mobile-menu" > -
+
Trade Stats Learn