give 1 sat fee button overlay but not button text

This commit is contained in:
keyan 2024-04-17 14:22:17 -05:00
parent dd6e921e2e
commit f9a99a7deb
3 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ export default function ActionTooltip ({ children, notForm, disable, overlayText
if (!notForm) { if (!notForm) {
formik = useFormikContext() formik = useFormikContext()
} }
if (disable) { if (disable || !overlayText) {
return children return children
} }
return ( return (
@ -16,7 +16,7 @@ export default function ActionTooltip ({ children, notForm, disable, overlayText
placement={placement || 'bottom'} placement={placement || 'bottom'}
overlay={ overlay={
<Tooltip> <Tooltip>
{overlayText || '1 sat'} {overlayText}
</Tooltip> </Tooltip>
} }
trigger={['hover', 'focus']} trigger={['hover', 'focus']}

View File

@ -118,12 +118,12 @@ export default function FeeButton ({ ChildButton = SubmitButton, variant, text,
? 'free' ? 'free'
: total > 1 : total > 1
? numWithUnits(total, { abbreviate: false, format: true }) ? numWithUnits(total, { abbreviate: false, format: true })
: total === 1 ? undefined : 'free' : undefined
disabled ||= ctxDisabled disabled ||= ctxDisabled
return ( return (
<div className={styles.feeButton}> <div className={styles.feeButton}>
<ActionTooltip overlayText={feeText}> <ActionTooltip overlayText={!free && total === 1 ? '1 sat' : feeText}>
<ChildButton variant={variant} disabled={disabled} nonDisabledText={feeText}>{text}</ChildButton> <ChildButton variant={variant} disabled={disabled} nonDisabledText={feeText}>{text}</ChildButton>
</ActionTooltip> </ActionTooltip>
{!me && <AnonInfo />} {!me && <AnonInfo />}

View File

@ -52,7 +52,7 @@ export default function Poll ({ item }) {
const variables = { id: v.id } const variables = { id: v.id }
return ( return (
<ActionTooltip placement='left' notForm> <ActionTooltip placement='left' notForm overlayText='1 sat'>
<Button <Button
variant='outline-info' className={styles.pollButton} variant='outline-info' className={styles.pollButton}
onClick={me onClick={me