Disable post button while dupes are loading
This commit is contained in:
parent
1a271432c7
commit
d43c7cc222
|
@ -39,7 +39,7 @@ function Receipt ({ cost, repetition, hasImgLink, baseFee, parentId, boost }) {
|
|||
)
|
||||
}
|
||||
|
||||
export default function FeeButton ({ parentId, hasImgLink, baseFee, ChildButton, variant, text, alwaysShow }) {
|
||||
export default function FeeButton ({ parentId, hasImgLink, baseFee, ChildButton, variant, text, alwaysShow, disabled }) {
|
||||
const query = parentId
|
||||
? gql`{ itemRepetition(parentId: "${parentId}") }`
|
||||
: gql`{ itemRepetition }`
|
||||
|
@ -53,7 +53,7 @@ export default function FeeButton ({ parentId, hasImgLink, baseFee, ChildButton,
|
|||
return (
|
||||
<div className='d-flex align-items-center'>
|
||||
<ActionTooltip overlayText={`${cost} sats`}>
|
||||
<ChildButton variant={variant}>{text}{cost > baseFee && show && <small> {cost} sats</small>}</ChildButton>
|
||||
<ChildButton variant={variant} disabled={disabled}>{text}{cost > baseFee && show && <small> {cost} sats</small>}</ChildButton>
|
||||
</ActionTooltip>
|
||||
{cost > baseFee && show &&
|
||||
<Info>
|
||||
|
|
|
@ -25,7 +25,7 @@ export function LinkForm ({ item, editThreshold }) {
|
|||
}`, {
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
const [getDupes, { data: dupesData }] = useLazyQuery(gql`
|
||||
const [getDupes, { data: dupesData, loading: dupesLoading }] = useLazyQuery(gql`
|
||||
${ITEM_FIELDS}
|
||||
query Dupes($url: String!) {
|
||||
dupes(url: $url) {
|
||||
|
@ -142,7 +142,7 @@ export function LinkForm ({ item, editThreshold }) {
|
|||
/>
|
||||
</div>)
|
||||
: <FeeButton
|
||||
baseFee={1} parentId={null} text='post'
|
||||
baseFee={1} parentId={null} text='post' disabled={dupesLoading}
|
||||
ChildButton={SubmitButton} variant='secondary'
|
||||
/>}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue