Skip to content

Commit

Permalink
tweak(SendTx): improve hints and unit for gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
brusherru committed Jul 19, 2024
1 parent b17af96 commit 0320291
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/FormInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Props<T extends FieldValues> = PropsWithChildren<{
isSubmitted?: boolean;
inputAddon?: ReactNode;
inputProps?: InputProps;
hint?: string;
hint?: ReactNode;
}>;

function FormInput<T extends FieldValues>({
Expand Down
36 changes: 27 additions & 9 deletions src/components/sendTx/SendTxModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1153,13 +1153,24 @@ function SendTxModal({ isOpen, onClose }: SendTxModalProps): JSX.Element {
errors={errors}
isSubmitted={isSubmitted}
inputAddon={
<InputRightElement mr={2}>
<Text fontSize="xs">Smidge</Text>
<InputRightElement w="auto" pr={2}>
<Text fontSize="xs">Smidge per unit</Text>
</InputRightElement>
}
// eslint-disable-next-line max-len
hint="How much to pay for gas: During high network traffic,
transactions with higher gas fees are prioritized."
hint={
<>
<Text mb={2}>
<strong>How much to pay per gas unit</strong>
<br />
During high network traffic, transactions with higher
gas prices are prioritized.
</Text>
<Text>
Example: transaction costs 25,000 gas units, gas price
is 2 smidges, the total fee will be 50,000 smidges.
</Text>
</>
}
/>
</Box>
<Box ml={2} w="50%">
Expand All @@ -1178,10 +1189,17 @@ function SendTxModal({ isOpen, onClose }: SendTxModalProps): JSX.Element {
})}
errors={errors}
isSubmitted={isSubmitted}
// eslint-disable-next-line max-len
hint="The number is used only once to ensure each transaction is unique.
It increments automatically,
but can also be set manually if needed."
hint={
<Text>
<strong>The transaction counter</strong>
<br />
The number is used only to ensure each transaction is
unique.
<br />
It increments automatically, but can be set manually if
needed.
</Text>
}
/>
</Box>
</Flex>
Expand Down

0 comments on commit 0320291

Please sign in to comment.