Skip to content

Commit

Permalink
🚸 (payment) Improve payment default currency be…
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Apr 11, 2024
1 parent 51bf5b6 commit 6594c56
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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')}
Expand All @@ -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>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export const StripeConfigModal = ({
placeholder="sk_test_..."
withVariableButton={false}
debounceTimeout={0}
type="password"
/>
</HStack>
</Stack>
Expand All @@ -187,6 +188,7 @@ export const StripeConfigModal = ({
placeholder="sk_live_..."
withVariableButton={false}
debounceTimeout={0}
type="password"
/>
</FormControl>
</HStack>
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const createStripePaymentIntent =
options.currency === 'EUR' ? 'fr-FR' : undefined,
{
style: 'currency',
currency: options.currency,
currency,
}
)

Expand Down

0 comments on commit 6594c56

Please sign in to comment.