-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
310 additions
and
86 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
frontend/src/app/(routes)/(overview)/overview-components/TransactionItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { formatTransaction } from '@/utils/transaction'; | ||
import Image from 'next/image'; | ||
|
||
const TransactionItem = ({ transaction }: { transaction: Transaction }) => { | ||
const uiTx = formatTransaction(transaction); | ||
|
||
return ( | ||
<div className="w-full flex gap-4"> | ||
<div className="flex gap-2 min-w-[88px]"> | ||
<div className="space-y-4"> | ||
<div className="ml-auto text-right text-[12px]">{uiTx.time}</div> | ||
<Image | ||
className="ml-auto" | ||
src="/back-arrow.svg" | ||
width={24} | ||
height={24} | ||
alt="transaction" | ||
/> | ||
</div> | ||
<Image | ||
width={12} | ||
height={112} | ||
alt="transaction" | ||
src="/vertical-divider.svg" | ||
/> | ||
</div> | ||
<div className="space-y-2"> | ||
<div className="formatted-text-1">{uiTx.firstMessage}</div> | ||
<div className="flex gap-2"> | ||
<Image width={20} height={20} alt="success" src="round-checked.svg" /> | ||
<div className="text-xs not-italic font-normal leading-4 tracking-[0.48px]"> | ||
{uiTx.isTxSuccess ? 'Transaction Successful' : 'Transaction Failed'} | ||
</div> | ||
</div> | ||
<div className="flex gap-4"> | ||
{uiTx.showMsgs[0] && <Chip msg={uiTx.showMsgs[0]} />} | ||
{uiTx.showMsgs[1] && <Chip msg={uiTx.showMsgs[1]} />} | ||
{uiTx.showMsgs[2] && <FilledChip />} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const Chip = ({ msg }: { msg: string }) => { | ||
return <div className="chip bg-[#26233b]">{msg}</div>; | ||
}; | ||
|
||
export const FilledChip = () => { | ||
return <div className="chip fill">+ 5 more</div>; | ||
}; | ||
|
||
export default TransactionItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.