-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add staked in farm tx overview row (#443)
- Loading branch information
Showing
8 changed files
with
63 additions
and
52 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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
30 changes: 30 additions & 0 deletions
30
...es/app/src/ui/organisms/new/transaction-overview/rows/TransactionOverviewStakedInFarm.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,30 @@ | ||
import { NormalizedUnitNumber } from '@/domain/types/NumericValues' | ||
import { Token } from '@/domain/types/Token' | ||
import { TokenIcon } from '@/ui/atoms/token-icon/TokenIcon' | ||
import { testIds } from '@/ui/utils/testIds' | ||
|
||
export interface TransactionOverviewStakedInFarmProps { | ||
token: Token | ||
amount: NormalizedUnitNumber | ||
farmName: string | ||
} | ||
|
||
export function TransactionOverviewStakedInFarm({ token, amount, farmName }: TransactionOverviewStakedInFarmProps) { | ||
const formattedAmount = token.format(amount, { style: 'auto' }) | ||
|
||
return ( | ||
<div className="flex w-fit items-center gap-1.5"> | ||
<TokenIcon token={token} className="h-4 w-4" /> | ||
<div className="flex items-baseline gap-1"> | ||
<div | ||
className="typography-label-4 text-primary" | ||
data-testid={testIds.farmDetails.stakeDialog.transactionOverview.outcome} | ||
> | ||
{formattedAmount} | ||
{/* @note: next line is need to maintain backward compatibility with e2e test - amount should include token symbol */} | ||
<span className="hidden"> {token.symbol}</span> Staked in {farmName} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |