fix: selected menu

This commit is contained in:
bartosz-lipinski 2020-11-19 12:56:51 -06:00
parent 1c63b1bc39
commit b4a2e4c564
2 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,7 @@ export const DepositAdd = (props: { className?: string, reserve: LendingReserve,
onChange={(val: any) => {
setValue(val);
}}
autoFocus={true}
style={{
fontSize: 20,
boxShadow: "none",

View File

@ -18,12 +18,15 @@ export const AppLayout = (props: any) => {
const location = useLocation();
console.log(location.pathname)
const defaultKey = ({
const paths: { [key: string]: string } = {
'/dashboard': '2',
'/deposit': '3',
'/borrow': '4'
} as any)[location.pathname] || '1'
};
const current = [...Object.keys(paths)].find(key => location.pathname.startsWith(key)) || '';
const defaultKey = paths[current] || "1";
return (
<div className="App">