-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ (payment) Add address in payment input
- Loading branch information
1 parent
b9f94cd
commit c469912
Showing
4 changed files
with
132 additions
and
2 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
apps/builder/src/features/blocks/inputs/payment/components/PaymentAddressSettings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { | ||
Stack, | ||
Accordion, | ||
AccordionButton, | ||
AccordionIcon, | ||
AccordionItem, | ||
AccordionPanel, | ||
} from '@chakra-ui/react' | ||
import React from 'react' | ||
import { TextInput } from '@/components/inputs' | ||
import { PaymentAddress } from '@typebot.io/schemas' | ||
|
||
type Props = { | ||
address: PaymentAddress | ||
onAddressChange: (address: PaymentAddress) => void | ||
} | ||
|
||
export const PaymentAddressSettings = ({ address, onAddressChange }: Props) => { | ||
const updateCountry = (country: string) => | ||
onAddressChange({ | ||
...address, | ||
country, | ||
}) | ||
|
||
const updateLine1 = (line1: string) => | ||
onAddressChange({ | ||
...address, | ||
line1, | ||
}) | ||
|
||
const updateLine2 = (line2: string) => | ||
onAddressChange({ | ||
...address, | ||
line2, | ||
}) | ||
|
||
const updateCity = (city: string) => | ||
onAddressChange({ | ||
...address, | ||
city, | ||
}) | ||
|
||
const updateState = (state: string) => | ||
onAddressChange({ | ||
...address, | ||
state, | ||
}) | ||
|
||
const updatePostalCode = (postalCode: string) => | ||
onAddressChange({ | ||
...address, | ||
postalCode, | ||
}) | ||
|
||
return ( | ||
<Accordion allowToggle> | ||
<AccordionItem> | ||
<AccordionButton justifyContent="space-between"> | ||
Address | ||
<AccordionIcon /> | ||
</AccordionButton> | ||
<AccordionPanel py={4} as={Stack} spacing="4"> | ||
<TextInput | ||
label="Country:" | ||
defaultValue={address?.country ?? ''} | ||
onChange={updateCountry} | ||
/> | ||
<TextInput | ||
label="Line 1:" | ||
defaultValue={address?.line1 ?? ''} | ||
onChange={updateLine1} | ||
/> | ||
<TextInput | ||
label="Line 2:" | ||
defaultValue={address?.line2 ?? ''} | ||
onChange={updateLine2} | ||
/> | ||
<TextInput | ||
label="City:" | ||
defaultValue={address?.city ?? ''} | ||
onChange={updateCity} | ||
/> | ||
<TextInput | ||
label="State:" | ||
defaultValue={address?.state ?? ''} | ||
onChange={updateState} | ||
/> | ||
<TextInput | ||
label="Postal code:" | ||
defaultValue={address?.postalCode ?? ''} | ||
onChange={updatePostalCode} | ||
/> | ||
</AccordionPanel> | ||
</AccordionItem> | ||
</Accordion> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c469912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./apps/docs
docs.typebot.io
docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
c469912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
landing-page-v2 – ./apps/landing-page
www.typebot.io
landing-page-v2-typebot-io.vercel.app
get-typebot.com
landing-page-v2-git-main-typebot-io.vercel.app
typebot.io
www.get-typebot.com
c469912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io
c469912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
rabbit.cr8.ai
turkey.cr8.ai
chat.webisharp.com
dicanatural.online
digitalhelp.com.au
goalsettingbot.com
noticiasnet.online
pant.maxbot.com.br
pantherview.cr8.ai
positivobra.com.br
rollingball.cr8.ai
survey.digienge.io
this-is-a-test.com
zap.techadviser.in
ai.digitaldaftar.in
bot.boston-voip.com
bot.cabinpromos.com
bot.carnaval.studio
bot.digitalbled.com
bot.dsignagency.com
bot.eventhub.com.au
bot.jepierre.com.br
bot.leadgenpod.site
bot.ltmidias.com.br
bot.viralsangat.com
bot.winglabs.com.br
carsalesenquiry.com
chat.marius.digital
chat.sr7digital.com
chatbot.matthesv.de
chatbot.repplai.com
demo.botscientis.us
demo.wemakebots.xyz
hrbot.robomotion.io
inearephones.cr8.ai
kbsub.wpwakanda.com
limitenahora.com.br
live.botscientis.us
mentoria.omelhor.vc
nutrisamirbayde.com
order.maitempah.com
profileadscloud.com
quest.wpwakanda.com
support.wawplus.com
survey1.digienge.io
surveys.essiell.com
test.botscientis.us
test.getreview.help
test.reventepro.com
typebot.stillio.com
wordsandimagery.com
88584434.therpm.club
bot.pinpointinteractive.com
bot.polychromes-project.com
bot.seidinembroseanchetu.it
chat.semanalimpanome.com.br
designguide.techyscouts.com
liveconvert2.kandalearn.com
poll.mosaicohairboutique.it
presente.empresarias.com.mx
register.algorithmpress.com
sell.sellthemotorhome.co.uk
anamnese.odontopavani.com.br
austin.channelautomation.com
bot.marketingplusmindset.com
bot.seidibergamoseanchetu.it
desabafe.sergiolimajr.com.br
download.venturemarketing.in
open.campus.aalen.university
piazzatorre.barrettamario.it
poll.mosaicohairboutique.com
type.cookieacademyonline.com
upload.atlasoutfittersk9.com
bot.brigadeirosemdrama.com.br
forms.escoladeautomacao.com.br
onboarding.libertydreamcare.ie
type.talitasouzamarques.com.br
agendamento.sergiolimajr.com.br
anamnese.clinicamegasjdr.com.br
bookings.littlepartymonkeys.com
bot.comercializadoraomicron.com
elevateyourmind.groovepages.com
viewer-v2-typebot-io.vercel.app
yourfeedback.comebackreward.com
bot.cabin-rentals-of-georgia.net
open.campus.bot.aalen.university
sondaggio.mosaicohairboutique.it
gerador.verificadordehospedes.com
personal-trainer.barrettamario.it
sondaggio.mosaicohairboutique.com
preagendamento.sergiolimajr.com.br
studiotecnicoimmobiliaremerelli.it
download.thailandmicespecialist.com
register.thailandmicespecialist.com
bot.studiotecnicoimmobiliaremerelli.it
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
chrome-os-inquiry-system.itschromeos.com
viewer-v2-git-main-typebot-io.vercel.app
main-menu-for-itschromeos.itschromeos.com