Skip to content

Commit

Permalink
Add transactions in AccountView component
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcoderistov committed Oct 18, 2022
1 parent 2d2048c commit 95c89d9
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions src/components/ConnectWalletModal/AccountView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import { Box, Typography, Button } from '@mui/material'
import Transaction from '../Transaction'
import { SportsVolleyball, MultilineChart } from '@mui/icons-material'
import { Transaction as TransactionI } from '../../types'


const AccountButton = (props: { title: string, onClick: () => void }) => {
Expand All @@ -27,6 +29,8 @@ const AccountButton = (props: { title: string, onClick: () => void }) => {

interface AccountViewProps {
address: string
transactions: TransactionI[]
onTransactionClick: (transaction: TransactionI) => void
onDisconnect: () => void
onChange: () => void
}
Expand Down Expand Up @@ -100,15 +104,36 @@ export default function AccountView (props: AccountViewProps) {
</Box>
</Box>
<Box mt='15px' />
<Box
component='div'
bgcolor='#2C2F36'
padding='20px'
>
<Typography fontSize={16}>
Your transactions will appear here...
</Typography>
</Box>
{ props.transactions.length > 0 ? (
<Box
component='div'
paddingX='20px'
paddingBottom='20px'
>
{ props.transactions.map(transaction => (
<Transaction
key={transaction.hash}
sellTokenSymbol={transaction.sellTokenSymbol}
sellTokenThumbnail={transaction.sellTokenThumbnail}
sellAmount={transaction.sellAmount}
buyTokenSymbol={transaction.buyTokenSymbol}
buyTokenThumbnail={transaction.buyTokenThumbnail}
buyAmount={transaction.buyAmount}
status={transaction.status}
onClick={() => props.onTransactionClick(transaction)} />
))}
</Box>
): (
<Box
component='div'
bgcolor='#2C2F36'
padding='20px'
>
<Typography fontSize={16}>
Your transactions will appear here...
</Typography>
</Box>
)}
</React.Fragment>
)
}

0 comments on commit 95c89d9

Please sign in to comment.