Skip to content

Commit

Permalink
feat: make boost button not go away (#468)
Browse files Browse the repository at this point in the history
Co-authored-by: Github Actions <[email protected]>
  • Loading branch information
kevkevinpal and Github Actions authored Oct 4, 2023
1 parent fc3ad37 commit 1da41ee
Showing 1 changed file with 28 additions and 34 deletions.
62 changes: 28 additions & 34 deletions src/components/Booster/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const Booster = ({ count = 0, updateCount, content, readOnly, refId }: Pr
notify(BOOST_SUCCESS)

if (updateCount) {
updateCount(count + 5)
updateCount(count + defaultBoostAmount)
}
} catch (e) {
notify(BOOST_ERROR_BUDGET)
Expand All @@ -85,39 +85,33 @@ export const Booster = ({ count = 0, updateCount, content, readOnly, refId }: Pr

return (
<div>
{isSuccess ? (
<Flex align="center" direction="row" justify="center">
<BoostIcon color="#49c998" fontSize={20} />
</Flex>
) : (
<Pill
disabled={isSuccess || submitting}
onClick={async () => {
if (isSuccess || submitting) {
return
}

await doBoost()
}}
style={{
padding: '4px 8px',
borderWidth: 0,
backgroundColor: '#303342',
height: '25px',
width: 'fit-content',
}}
>
{submitting ? (
<ClipLoader color="#fff" loading size={10} />
) : (
<Flex align="center" direction="row" justify="space-around">
<BoostIcon style={{ color: colors.white }} />

<div style={{ marginLeft: 8, marginRight: 8 }}>Boost</div>
</Flex>
)}
</Pill>
)}
<Pill
disabled={submitting}
onClick={async () => {
if (isSuccess || submitting) {
return
}

await doBoost()
}}
style={{
padding: '4px 8px',
borderWidth: 0,
backgroundColor: '#303342',
height: '25px',
width: 'fit-content',
}}
>
{submitting ? (
<ClipLoader color="#fff" loading size={10} />
) : (
<Flex align="center" direction="row" justify="space-around">
<BoostIcon style={{ color: colors.white }} />

<div style={{ marginLeft: 8, marginRight: 8 }}>Boost</div>
</Flex>
)}
</Pill>
</div>
)
}

0 comments on commit 1da41ee

Please sign in to comment.