Skip to content

Commit

Permalink
💄 Show send icon by default on textboxes
Browse files Browse the repository at this point in the history
Closes #1418
  • Loading branch information
baptisteArno committed Apr 24, 2024
1 parent dc1929e commit 873ba0b
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.2.78",
"version": "0.2.79",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions packages/embeds/js/src/components/SendButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const SendButton = (props: SendButtonProps) => {
return (
<Button type="submit" {...others}>
{(isMobile() && !local.disableIcon) ||
!props.children ||
(typeof props.children === 'string' && isEmpty(props.children)) ? (
<SendIcon
class={'send-icon flex ' + (local.disableIcon ? 'hidden' : '')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { InputSubmitContent } from '@/types'
import { DateInputBlock } from '@typebot.io/schemas'
import { createSignal } from 'solid-js'
import { defaultDateInputOptions } from '@typebot.io/schemas/features/blocks/inputs/date/constants'
import clsx from 'clsx'

type Props = {
onSubmit: (inputValue: InputSubmitContent) => void
Expand All @@ -19,7 +20,10 @@ export const DateForm = (props: Props) => {
<div class="flex flex-col">
<div class="flex items-center">
<form
class={'flex justify-between typebot-input pr-2 items-end'}
class={clsx(
'flex justify-between typebot-input pr-2',
props.options?.isRange ? 'items-end' : 'items-center'
)}
onSubmit={(e) => {
if (inputValues().from === '' && inputValues().to === '') return
e.preventDefault()
Expand Down Expand Up @@ -95,8 +99,7 @@ export const DateForm = (props: Props) => {
</div>

<SendButton class="my-2 ml-2">
{props.options?.labels?.button ??
defaultDateInputOptions.labels.button}
{props.options?.labels?.button}
</SendButton>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ export const EmailInput = (props: Props) => {
autocomplete="email"
/>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultEmailInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ export const NumberInput = (props: NumberInputProps) => {
step={props.block.options?.step ?? 'any'}
/>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultNumberInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const PhoneInput = (props: PhoneInputProps) => {
</div>

<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.labels?.button ?? defaultPhoneInputOptions.labels.button}
{props.labels?.button}
</SendButton>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export const TextInput = (props: Props) => {
/>
)}
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultTextInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ export const UrlInput = (props: Props) => {
autocomplete="url"
/>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultUrlInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.2.78",
"version": "0.2.79",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.78",
"version": "0.2.79",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 873ba0b

Please sign in to comment.