Skip to content

Commit

Permalink
🩹Refactor InspectVault to use For component for rendering strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPoblete committed Nov 22, 2024
1 parent 8a54d05 commit 9d9df71
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions apps/dapp/src/components/ManageVaults/InspectVault.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
'use client'
import { useContext } from "react"
import { useSorobanReact } from "@soroban-react/core"

import { ModalContext } from "@/contexts"
import { shortenAddress } from "@/helpers/address"
import { useVault, VaultMethod } from "@/hooks/useVault"
import { VaultMethod } from "@/hooks/useVault"

import { useAppSelector } from "@/store/lib/storeHooks"
import { Asset, AssetAmmount, VaultData } from "@/store/lib/types"
import { Asset, AssetAmmount, Strategy, VaultData } from "@/store/lib/types"

import { Button, Grid, GridItem, HStack, Icon, Stack, Text } from "@chakra-ui/react"
import { Button, For, Grid, GridItem, HStack, Icon, Stack, Text } from "@chakra-ui/react"
import { DialogBody, DialogContent, DialogFooter, DialogHeader } from "../ui/dialog"
import { FaRegEdit } from "react-icons/fa"
import { IoClose } from "react-icons/io5"
import { ClipboardIconButton, ClipboardRoot } from "../ui/clipboard"
import { ModalContext } from "@/contexts"
import { useContext } from "react"


export const InspectVault = ({
Expand Down Expand Up @@ -68,10 +68,16 @@ export const InspectVault = ({
<Stack>
<Text>Strategies:</Text>
{selectedVault.assets.map((asset: Asset, index: number) => (
<HStack key={index} alignContent={'center'}>
{asset.strategies[0]?.name}
<Text fontSize={'2xs'}>{`(${asset.symbol})`}</Text>
</HStack>
<Stack>
<For each={asset.strategies}>
{(strategy: Strategy, index: number) => (
<HStack key={index} alignContent={'center'}>
{strategy.name}
<Text fontSize={'2xs'}>{`(${asset.symbol})`}</Text>
</HStack>
)}
</For>
</Stack>
))}
</Stack>
<Stack>
Expand Down

0 comments on commit 9d9df71

Please sign in to comment.