diff --git a/apps/marginfi-v2-ui/src/components/common/icons/More.tsx b/apps/marginfi-v2-ui/src/components/common/icons/More.tsx new file mode 100644 index 0000000000..2cd56abfe2 --- /dev/null +++ b/apps/marginfi-v2-ui/src/components/common/icons/More.tsx @@ -0,0 +1,10 @@ +import React, { FC, SVGProps } from "react"; + +const More: FC> = ({ color = "#868E95", ...props }) => ( + + + + +); + +export { More }; diff --git a/apps/marginfi-v2-ui/src/components/common/icons/index.ts b/apps/marginfi-v2-ui/src/components/common/icons/index.ts index e6afd3b1f4..5802262b09 100644 --- a/apps/marginfi-v2-ui/src/components/common/icons/index.ts +++ b/apps/marginfi-v2-ui/src/components/common/icons/index.ts @@ -1,3 +1,7 @@ -export * from "./PieChart" -export * from "./ReceiveMoney" -export * from "./TokenSwap" +export * from "./PieChart"; +export * from "./ReceiveMoney"; +export * from "./TokenSwap"; +export * from "./More"; +export * from "./Steak"; +export * from "./Coins"; +export * from "./Bridge"; diff --git a/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/AssetCard/AssetCard.tsx b/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/AssetCard/AssetCard.tsx index 502053d2a7..2551f224a1 100644 --- a/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/AssetCard/AssetCard.tsx +++ b/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/AssetCard/AssetCard.tsx @@ -46,10 +46,7 @@ export const AssetCard: FC<{ [bank.info.state.mint, bank.userInfo.tokenAccount, nativeSolBalance] ); - const currentAction: ActionType = useMemo( - () => getCurrentAction(isInLendingMode, bank), - [connected, isInLendingMode, bank] - ); + const currentAction: ActionType = useMemo(() => getCurrentAction(isInLendingMode, bank), [isInLendingMode, bank]); const handleCloseBalance = useCallback(async () => { try { diff --git a/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx b/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx index fffc7844f2..bc60a3db10 100644 --- a/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx +++ b/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx @@ -1,22 +1,13 @@ import React, { FC, useMemo, useRef, useState } from "react"; import Image from "next/image"; import { ExtendedBankInfo } from "@mrgnlabs/marginfi-v2-ui-state"; -import { - FormControl, - FormHelperText, - MenuItem, - Select, - SelectChangeEvent, - Skeleton, - Typography, - paperClasses, -} from "@mui/material"; +import { FormControl, MenuItem, Select, SelectChangeEvent, Skeleton, Typography } from "@mui/material"; import { useMrgnlendStore } from "~/store"; import { useWalletContext } from "~/hooks/useWalletContext"; import { MrgnContainedSwitch, MrgnLabeledSwitch, MrgnTooltip } from "~/components/common"; import { AssetCard } from "./AssetCard"; -import { SORT_OPTIONS_MAP, SortAssetOption, sortApRate, sortTvl } from "./MobileAssetsList.utils"; +import { SORT_OPTIONS_MAP, SortAssetOption, SortType, sortApRate, sortTvl } from "./MobileAssetsList.utils"; export const MobileAssetsList: FC = () => { const [isFiltered, setIsFiltered] = useState(false); @@ -33,12 +24,10 @@ export const MobileAssetsList: FC = () => { const inputRefs = useRef>({}); const [isInLendingMode, setIsInLendingMode] = useState(true); - // const test = useMemo(() => sortedBanks && sortedBanks.sort((a,b) => a.) ,[]) - - const sortBanks = (banks: ExtendedBankInfo) => { - if (sortOption.field === "APY") { + const sortBanks = (banks: ExtendedBankInfo[]) => { + if (sortOption?.field === "APY") { return sortApRate(banks, isInLendingMode, sortOption.direction); - } else if (sortOption.field === "TVL") { + } else if (sortOption?.field === "TVL") { return sortTvl(banks, sortOption.direction); } else { return banks; @@ -69,7 +58,7 @@ export const MobileAssetsList: FC = () => { }, [sortedBanks, isFiltered, sortOption]); const handleSortChange = (event: SelectChangeEvent) => { - setSortOption(SORT_OPTIONS_MAP[event.target.value]); + setSortOption(SORT_OPTIONS_MAP[event.target.value as SortType]); }; return ( @@ -131,6 +120,7 @@ export const MobileAssetsList: FC = () => { {Object.values(SORT_OPTIONS_MAP).map((option) => (