mirror of https://github.com/certusone/oyster.git
fix: selected menu
This commit is contained in:
parent
1c63b1bc39
commit
b4a2e4c564
|
@ -75,6 +75,7 @@ export const DepositAdd = (props: { className?: string, reserve: LendingReserve,
|
|||
onChange={(val: any) => {
|
||||
setValue(val);
|
||||
}}
|
||||
autoFocus={true}
|
||||
style={{
|
||||
fontSize: 20,
|
||||
boxShadow: "none",
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue