💄 (textInput) Show send icon if send label is empty
This commit is contained in:
@@ -3,6 +3,7 @@ import { splitProps } from 'solid-js'
|
|||||||
import { JSX } from 'solid-js/jsx-runtime'
|
import { JSX } from 'solid-js/jsx-runtime'
|
||||||
import { SendIcon } from './icons'
|
import { SendIcon } from './icons'
|
||||||
import { Button } from './Button'
|
import { Button } from './Button'
|
||||||
|
import { isEmpty } from '@typebot.io/lib'
|
||||||
|
|
||||||
type SendButtonProps = {
|
type SendButtonProps = {
|
||||||
isDisabled?: boolean
|
isDisabled?: boolean
|
||||||
@@ -14,7 +15,8 @@ export const SendButton = (props: SendButtonProps) => {
|
|||||||
const [local, others] = splitProps(props, ['disableIcon'])
|
const [local, others] = splitProps(props, ['disableIcon'])
|
||||||
return (
|
return (
|
||||||
<Button type="submit" {...others}>
|
<Button type="submit" {...others}>
|
||||||
{isMobile() && !local.disableIcon ? (
|
{(isMobile() && !local.disableIcon) ||
|
||||||
|
(typeof props.children === 'string' && isEmpty(props.children)) ? (
|
||||||
<SendIcon
|
<SendIcon
|
||||||
class={'send-icon flex ' + (local.disableIcon ? 'hidden' : '')}
|
class={'send-icon flex ' + (local.disableIcon ? 'hidden' : '')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user