2
0

🚸 (payment) Improve payment default currency be…

This commit is contained in:
Baptiste Arnaud
2024-04-11 11:03:02 +02:00
parent 51bf5b653c
commit 6594c56adf
4 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,7 @@
import { Text } from '@chakra-ui/react'
import { useTranslate } from '@tolgee/react'
import { PaymentInputBlock } from '@typebot.io/schemas'
import { defaultPaymentInputOptions } from '@typebot.io/schemas/features/blocks/inputs/payment/constants'
type Props = {
block: PaymentInputBlock
@ -9,11 +10,7 @@ type Props = {
export const PaymentInputContent = ({ block }: Props) => {
const { t } = useTranslate()
if (
!block.options?.amount ||
!block.options.credentialsId ||
!block.options.currency
)
if (!block.options?.amount || !block.options.credentialsId)
return (
<Text color="gray.500">
{t('blocks.inputs.payment.placeholder.label')}
@ -22,7 +19,7 @@ export const PaymentInputContent = ({ block }: Props) => {
return (
<Text noOfLines={1} pr="6">
{t('blocks.inputs.payment.collect.label')} {block.options.amount}{' '}
{block.options.currency}
{block.options.currency ?? defaultPaymentInputOptions.currency}
</Text>
)
}

View File

@ -163,6 +163,7 @@ export const StripeConfigModal = ({
placeholder="sk_test_..."
withVariableButton={false}
debounceTimeout={0}
type="password"
/>
</HStack>
</Stack>
@ -187,6 +188,7 @@ export const StripeConfigModal = ({
placeholder="sk_live_..."
withVariableButton={false}
debounceTimeout={0}
type="password"
/>
</FormControl>
</HStack>

View File

@ -143,7 +143,7 @@
"blocks.inputs.file.settings.skip.label": "Skip button label:",
"blocks.inputs.fileUpload.blockCard.tooltip": "Upload Files",
"blocks.inputs.number.settings.step.label": "Step:",
"blocks.inputs.payment.collect.label": "Coletar",
"blocks.inputs.payment.collect.label": "Collect",
"blocks.inputs.payment.placeholder.label": "Configure...",
"blocks.inputs.payment.settings.account.label": "Account:",
"blocks.inputs.payment.settings.accountText.label": "{provider} account",

View File

@ -77,7 +77,7 @@ const createStripePaymentIntent =
options.currency === 'EUR' ? 'fr-FR' : undefined,
{
style: 'currency',
currency: options.currency,
currency,
}
)