-
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.
- Loading branch information
Showing
8 changed files
with
115 additions
and
9 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
54 changes: 54 additions & 0 deletions
54
dapp/src/components/TransactionModal/FeesPopover/FeesPopover.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,54 @@ | ||
import React from "react" | ||
import { Info } from "#/assets/icons" | ||
import { | ||
Popover, | ||
PopoverTrigger, | ||
PopoverContent, | ||
PopoverArrow, | ||
PopoverBody, | ||
Icon, | ||
VStack, | ||
} from "@chakra-ui/react" | ||
import { FeesItemType, FeesPopoverItem } from "./FeesPopoverItem" | ||
|
||
const fees: Array<FeesItemType> = [ | ||
{ | ||
label: "Acre protocol fees", | ||
amount: "100000", | ||
currency: "bitcoin", | ||
}, | ||
{ | ||
label: "tBTC bridge fees", | ||
amount: "240000", | ||
currency: "bitcoin", | ||
}, | ||
{ | ||
label: "Bitcoin network fees", | ||
amount: "200000", | ||
currency: "bitcoin", | ||
}, | ||
] | ||
|
||
export function FeesPopover() { | ||
return ( | ||
<Popover isLazy placement="right"> | ||
<PopoverTrigger> | ||
<Icon as={Info} ml={2} boxSize={5} cursor="pointer" color="grey.400" /> | ||
</PopoverTrigger> | ||
<PopoverContent color="white" bg="grey.700" p={3} borderRadius="xl"> | ||
<PopoverArrow bg="grey.700" /> | ||
<PopoverBody> | ||
<VStack gap={0.5}> | ||
{fees.map((fee) => ( | ||
<FeesPopoverItem | ||
label={fee.label} | ||
amount={fee.amount} | ||
currency={fee.currency} | ||
/> | ||
))} | ||
</VStack> | ||
</PopoverBody> | ||
</PopoverContent> | ||
</Popover> | ||
) | ||
} |
27 changes: 27 additions & 0 deletions
27
dapp/src/components/TransactionModal/FeesPopover/FeesPopoverItem.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,27 @@ | ||
import React from "react" | ||
import { HStack } from "@chakra-ui/react" | ||
import { | ||
CurrencyBalance, | ||
CurrencyBalanceProps, | ||
} from "#/components/shared/CurrencyBalance" | ||
import { TextSm } from "#/components/shared/Typography" | ||
|
||
export type FeesItemType = CurrencyBalanceProps & { | ||
label: string | ||
} | ||
|
||
export function FeesPopoverItem({ label, amount, ...props }: FeesItemType) { | ||
return ( | ||
<HStack w="100%" justifyContent="space-between"> | ||
<TextSm color="white">{label}</TextSm> | ||
<CurrencyBalance | ||
size="sm" | ||
amount={amount} | ||
color="gold.400" | ||
balanceFontWeight="semibold" | ||
symbolFontWeight="semibold" | ||
{...props} | ||
/> | ||
</HStack> | ||
) | ||
} |
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 @@ | ||
export * from "./FeesPopover" |
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