Skip to content

Commit

Permalink
Make zero waste screen look more like web. Fixes #1630.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura committed Dec 20, 2023
1 parent 22cea96 commit cda5255
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@
"RESTAURANT_LOOPEAT_UPDATE_FORMATS": "Update packagings",
"SESSION_ERROR_TRY_AGAIN": "An error occurred with the session, please login and try again.",
"FAILURE_REASON": "Failure Reason",
"CHECKOUT_LOOPEAT_CONNECT_ACCOUNT_TEXT": "Connect your {{name}} account to continue, or disable the zero waste option"
"CHECKOUT_LOOPEAT_CONNECT_ACCOUNT_TEXT": "Connect your {{name}} account to continue, or disable the zero waste option",
"CHECKOUT_LOOPEAT_MISSING_AMOUNT": "{{amount}} missing to complete your order",
"CHECKOUT_LOOPEAT_WALLET_AMOUNT": "Wallet ({{amount}})"
}
}
4 changes: 3 additions & 1 deletion src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@
"ZERO_WASTE": "Zéro déchet",
"RESTAURANT_LOOPEAT_UPDATE_FORMATS": "Modifier les emballages",
"FAILURE_REASON": "Raison de l'échec",
"CHECKOUT_LOOPEAT_CONNECT_ACCOUNT_TEXT": "Connectez votre compte {{name}} pour continuer, ou désactivez l'option zéro déchet"
"CHECKOUT_LOOPEAT_CONNECT_ACCOUNT_TEXT": "Connectez votre compte {{name}} pour continuer, ou désactivez l'option zéro déchet",
"CHECKOUT_LOOPEAT_MISSING_AMOUNT": "Il manque {{amount}} pour finaliser votre commande",
"CHECKOUT_LOOPEAT_WALLET_AMOUNT": "Ma cagnotte ({{amount}})"
}
}
10 changes: 4 additions & 6 deletions src/navigation/checkout/Loopeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,13 @@ function Loopeat({ cart, updateLoopeatReturns }) {
}} />
</Box>
) }
{ missingAmount > 0 &&
<Box p="3">
<Heading size="sm" mb="4">{ t('CHECKOUT_LOOPEAT_WALLET_AMOUNT', { amount: formatPrice(creditsCountCents) }) }</Heading>
<Button variant="outline"
onPress={ () => Linking.openURL(reusablePackagingAction.loopeatOAuthUrl + '&required_credits_cents=' + requiredAmount) }>
{ t('CHECKOUT_LOOPEAT_ADD_CREDITS') }
</Button>
</Box>
}
<Box p="3">
<VStack mb="3">
<HStack justifyContent="space-between">
Expand All @@ -125,11 +124,10 @@ function Loopeat({ cart, updateLoopeatReturns }) {
<Text>{ t('CHECKOUT_LOOPEAT_TOTAL_RETURNS') }</Text>
<Text>{ formatPrice(returnsTotalAmount) }</Text>
</HStack>
<HStack justifyContent="space-between">
<Text>{ t('CHECKOUT_LOOPEAT_DIFF') }</Text>
<Text>{ formatPrice(missingAmount * -1) }</Text>
</HStack>
</VStack>
{ missingAmount > 0 && (
<Text textAlign="center" mb="2" color="red.500">{ t('CHECKOUT_LOOPEAT_MISSING_AMOUNT', { amount: formatPrice(missingAmount) }) }</Text>
) }
<Button onPress={ () => {
updateLoopeatReturns(returns)
navigation.navigate('CheckoutSummary')
Expand Down

0 comments on commit cda5255

Please sign in to comment.