diff --git a/src/App.tsx b/src/App.tsx index 585ef90..df701f6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,22 +10,20 @@ import ManualReallocationPage from "./pages/manualReallocationPage"; const App: React.FC = () => { const [network, setNetwork] = useState<"ethereum" | "base">("ethereum"); - const handleNetworkSwitch = () => { - setNetwork((prevNetwork) => - prevNetwork === "ethereum" ? "base" : "ethereum" - ); + const handleNetworkSwitch = (selectedNetwork: "ethereum" | "base") => { + setNetwork(selectedNetwork); }; return ( -
-
+
+
` font-weight: 500; height: 100%; transition: all 0.3s; - &:hover { background-color: ${(props) => (props.$isActive ? "#2973FF" : "#3a3f45")}; } @@ -45,7 +44,7 @@ export const NetworkSelector = styled.div` background-color: #2c2f33; border-radius: 9999px; height: 45px; - margin-left: auto; + /* Remove margin-left:auto here */ `; export const NetworkButton = styled.button<{ $isActive: boolean }>` @@ -56,14 +55,12 @@ export const NetworkButton = styled.button<{ $isActive: boolean }>` background-color: ${(props) => (props.$isActive ? "#2973FF" : "transparent")}; border-radius: 9999px; padding: 8px 16px; - text-decoration: none; font-size: 0.875rem; font-weight: 500; height: 100%; transition: all 0.3s; border: none; cursor: pointer; - &:hover { background-color: ${(props) => (props.$isActive ? "#2973FF" : "#3a3f45")}; } @@ -72,6 +69,13 @@ export const NetworkButton = styled.button<{ $isActive: boolean }>` export const ethLogo = "https://cdn.morpho.org/assets/chains/eth.svg"; export const baseLogo = "https://cdn.morpho.org/assets/chains/base.png"; +const NetworkContainer = styled.div` + display: flex; + flex-direction: column; + align-items: flex-end; + margin-left: auto; +`; + type NetworkOption = { value: "ethereum" | "base"; label: JSX.Element; @@ -113,9 +117,7 @@ type NavBarProps = { const NavBar: React.FC = ({ currentNetwork, onNetworkSwitch }) => { const location = useLocation(); - const chainId = useChainId(); - const defaultNetwork = chainId === 8453 ? "base" : chainId === 1 ? "ethereum" : "ethereum"; const [selectedNetwork, setSelectedNetwork] = useState( @@ -157,17 +159,22 @@ const NavBar: React.FC = ({ currentNetwork, onNetworkSwitch }) => { ))} - - {networkOptions.map((option) => ( - handleNetworkChange(option.value)} - > - {option.label} - - ))} - + + + {networkOptions.map((option) => ( + handleNetworkChange(option.value)} + > + {option.label} + + ))} + +
+ Default is latest connected chain +
+
); }; diff --git a/src/pages/vaultPage.tsx b/src/pages/vaultPage.tsx index dd7ea15..362638c 100644 --- a/src/pages/vaultPage.tsx +++ b/src/pages/vaultPage.tsx @@ -495,7 +495,9 @@ const VaultPage: React.FC = ({ network }) => { -

Morpho Vaults

+

+ Morpho Vaults - {network} +

Number of vaults: {filteredVaults.length}