Skip to content

Commit

Permalink
fix: Hide fee in pay now if can relay
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Feb 9, 2024
1 parent 99cb71d commit 1333b55
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/new-safe/create/steps/ReviewStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const ReviewStep = ({ data, onSubmit, onBack, setStep }: StepRenderProps<NewSafe
<>
<Divider />
<Box className={layoutCss.row}>
<PayNowPayLater totalFee={totalFee} payMethod={payMethod} setPayMethod={setPayMethod} />
<PayNowPayLater totalFee={totalFee} canRelay={canRelay} payMethod={payMethod} setPayMethod={setPayMethod} />
</Box>
</>
)}
Expand Down
14 changes: 11 additions & 3 deletions src/features/counterfactual/PayNowPayLater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export const enum PayMethod {

const PayNowPayLater = ({
totalFee,
canRelay,
payMethod,
setPayMethod,
}: {
totalFee: string
canRelay: boolean
payMethod: PayMethod
setPayMethod: Dispatch<SetStateAction<PayMethod>>
}) => {
Expand Down Expand Up @@ -67,8 +69,14 @@ const PayNowPayLater = ({
label={
<>
<Typography className={css.radioTitle}>Pay now</Typography>
<Typography variant="body2" color="text.secondary">
&asymp; {totalFee} {chain?.nativeCurrency.symbol}
<Typography className={css.radioSubtitle} variant="body2" color="text.secondary">
{canRelay ? (
'Sponsored free transaction'
) : (
<>
&asymp; {totalFee} {chain?.nativeCurrency.symbol}
</>
)}
</Typography>
</>
}
Expand All @@ -83,7 +91,7 @@ const PayNowPayLater = ({
label={
<>
<Typography className={css.radioTitle}>Pay later</Typography>
<Typography variant="body2" color="text.secondary">
<Typography className={css.radioSubtitle} variant="body2" color="text.secondary">
with the first transaction
</Typography>
</>
Expand Down
4 changes: 4 additions & 0 deletions src/features/counterfactual/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
font-weight: bold;
}

.active .radioSubtitle {
color: var(--color-text-primary);
}

@media (max-width: 400px) {
.radioGroup {
flex-direction: column;
Expand Down

0 comments on commit 1333b55

Please sign in to comment.