Skip to content

Commit

Permalink
fix(components): update History component
Browse files Browse the repository at this point in the history
Update History component according to new subgraph structure
  • Loading branch information
AshenI99 authored Mar 23, 2022
2 parents 14b69c3 + af0df3e commit 0885e3c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
16 changes: 7 additions & 9 deletions packages/components/src/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import moment from "moment";
type historyProps = {
type: string
timestamp: string
mintBy?: { id : string | null } | null
burnBy?: { id : string | null } | null
bidBy?: { id : string | null } | null
transferFrom?: { id : string | null } | null
transferTo?: { id : string | null } | null
amount: number | null
sender?: { id : string | null } | null
recipient?: { id : string | null } | null
transactionHash: string
}

Expand Down Expand Up @@ -124,10 +122,10 @@ export function History ({ history = [] } : {
transactionHash={ historyItem.transactionHash }
>
<>
{historyItem.type == "burn" && <Burn accountId = {historyItem.burnBy!.id! }/> }
{historyItem.type == "mint" && <Mint accountId = {historyItem.mintBy!.id! }/> }
{historyItem.type == "bid" && <Bid accountId = {historyItem.bidBy!.id! }/> }
{historyItem.type == "transfer" && <Transfer accountId = {historyItem.transferFrom!.id! } receiverId={ historyItem.transferTo!.id! } /> }
{historyItem.type == "burn" && <Burn accountId = {historyItem.sender!.id! }/> }
{historyItem.type == "mint" && <Mint accountId = {historyItem.sender!.id! }/> }
{historyItem.type == "set_bid" && <Bid accountId = {historyItem.sender!.id! }/> }
{historyItem.type == "transfer" && <Transfer accountId = {historyItem.sender!.id! } receiverId={ historyItem.recipient!.id! } /> }
</>
</HistoryItemLayout>
)
Expand Down
32 changes: 12 additions & 20 deletions packages/components/src/stories/History.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,30 @@ Tre.args = {
{
type: "mint",
timestamp: "1641199188285678087",
mintBy: { id: "demo.testnet" },
burnBy: null,
bidBy: null,
transferFrom: null,
transferTo: null,
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578ggnkk98989787fbjby8"
}, {
type: "bid",
timestamp: "1649199188285678087",
mintBy: null,
burnBy: null,
bidBy: { id: "demo.testnet" },
transferFrom: null,
transferTo: null,
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578FFFbb5654fbjby8"
}, {
type: "burn",
timestamp: "1642599168285678017",
mintBy: null,
burnBy: { id: "demo.testnet" },
bidBy: null,
transferFrom: null,
transferTo: null,
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578gg4666h583vvnkk98989787fbjby8"
}, {
type: "transfer",
timestamp: "1642199908285679017",
mintBy: null,
burnBy: null,
bidBy: null,
transferFrom: { id: "demo.testnet" },
transferTo: {id : "demo2.testnet" },
sender: { id: "demo.testnet" },
recipient: {id : "demo2.testnet" },
amount: null,
transactionHash: "aadddJhjdB7889HUu?78dvfn89787fbjby8"
}
]
Expand Down

1 comment on commit 0885e3c

@vercel
Copy link

@vercel vercel bot commented on 0885e3c Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.