added tip jar
This commit is contained in:
parent
c2d112e516
commit
4381911dbd
|
@ -5,6 +5,7 @@ import { Button } from 'web/components/button'
|
||||||
import { formatMoney, shortFormatNumber } from 'common/util/format'
|
import { formatMoney, shortFormatNumber } from 'common/util/format'
|
||||||
import { Col } from 'web/components/layout/col'
|
import { Col } from 'web/components/layout/col'
|
||||||
import { Tooltip } from '../tooltip'
|
import { Tooltip } from '../tooltip'
|
||||||
|
import TipJar from 'web/public/custom-components/tipJar'
|
||||||
|
|
||||||
export function TipButton(props: {
|
export function TipButton(props: {
|
||||||
tipAmount: number
|
tipAmount: number
|
||||||
|
@ -41,26 +42,22 @@ export function TipButton(props: {
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
<Col className={'relative items-center sm:flex-row'}>
|
<Col
|
||||||
<HeartIcon
|
className={
|
||||||
className={clsx(
|
'relative items-center transition-transform hover:rotate-12 sm:flex-row'
|
||||||
'h-5 w-5',
|
}
|
||||||
totalTipped > 0 ? 'mr-2' : '',
|
>
|
||||||
userTipped ? 'fill-teal-500 text-teal-500' : ''
|
<TipJar />
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{totalTipped > 0 && (
|
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'bg-greyscale-5 absolute ml-3.5 mt-2 h-4 w-4 rounded-full align-middle text-white sm:mt-3 sm:h-5 sm:w-5 sm:px-1',
|
'bg-greyscale-5 absolute rounded-full text-white',
|
||||||
tipDisplay.length > 2
|
tipDisplay.length > 2
|
||||||
? 'text-[0.4rem] sm:text-[0.5rem]'
|
? 'text-[0.4rem] sm:text-[0.5rem]'
|
||||||
: 'sm:text-2xs text-[0.5rem]'
|
: 'text-[0.5rem]'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{tipDisplay}
|
{totalTipped > 0 ? tipDisplay : ''}
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</Col>
|
</Col>
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user