Skip to content

Commit

Permalink
💄 (textInput) Show send icon if send label is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Aug 7, 2023
1 parent 4d3f67c commit ec0a5be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/embeds/js/src/components/SendButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { splitProps } from 'solid-js'
import { JSX } from 'solid-js/jsx-runtime'
import { SendIcon } from './icons'
import { Button } from './Button'
import { isEmpty } from '@typebot.io/lib'

type SendButtonProps = {
isDisabled?: boolean
Expand All @@ -14,7 +15,8 @@ export const SendButton = (props: SendButtonProps) => {
const [local, others] = splitProps(props, ['disableIcon'])
return (
<Button type="submit" {...others}>
{isMobile() && !local.disableIcon ? (
{(isMobile() && !local.disableIcon) ||
(typeof props.children === 'string' && isEmpty(props.children)) ? (
<SendIcon
class={'send-icon flex ' + (local.disableIcon ? 'hidden' : '')}
/>
Expand Down

0 comments on commit ec0a5be

Please sign in to comment.