Skip to content

Commit

Permalink
feat: Improved bubble.io destination providing (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik committed Jun 25, 2024
2 parents d44dba9 + c932173 commit 41feee6
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions apps/web/components/imports/destination/Destination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ interface DestinationProps {

export function Destination({ template }: DestinationProps) {
const {
destination,
register,
control,
watch,
errors,
control,
onSubmit,
setValue,
register,
destination,
setDestination,
resetDestination,
mapBubbleIoColumnsClick,
Expand All @@ -39,6 +40,7 @@ export function Destination({ template }: DestinationProps) {
setValue('destination', newDestination);
}
};
const bubbleDestinationEnvironment = watch('bubbleIo.environment');

return (
<Stack>
Expand Down Expand Up @@ -107,15 +109,6 @@ export function Destination({ template }: DestinationProps) {
)}
/>

<Input
label="Custom Domain Name"
placeholder="Custom Domain Name"
{...register('bubbleIo.customDomainName', {
pattern: /^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$/,
})}
description="Required, if application is hosted on custom domain. Ex. myapp.io"
error={errors?.bubbleIo?.customDomainName ? 'Please enter valid domain name' : undefined}
/>
<Controller
control={control}
name="bubbleIo.environment"
Expand All @@ -132,6 +125,17 @@ export function Destination({ template }: DestinationProps) {
/>
)}
/>
{bubbleDestinationEnvironment === 'production' && (
<Input
label="Custom Domain Name"
placeholder="Custom Domain Name"
{...register('bubbleIo.customDomainName', {
pattern: /^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$/,
})}
description="Required, if application is hosted on custom domain. Ex. myapp.io"
error={errors?.bubbleIo?.customDomainName ? 'Please enter valid domain name' : undefined}
/>
)}
<Input
required
label="API Private Key"
Expand Down

0 comments on commit 41feee6

Please sign in to comment.