Add fee estimation warning
This commit is contained in:
parent
e2c755515b
commit
cf07cc3cf5
@ -7,6 +7,7 @@ export interface TooltipProps extends ComponentProps<'div'> {
|
|||||||
label: ReactNode
|
label: ReactNode
|
||||||
children: ReactElement
|
children: ReactElement
|
||||||
placement?: 'top' | 'bottom' | 'left' | 'right'
|
placement?: 'top' | 'bottom' | 'left' | 'right'
|
||||||
|
backgroundColor?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Tooltip = ({ label, children, ...props }: TooltipProps) => {
|
export const Tooltip = ({ label, children, ...props }: TooltipProps) => {
|
||||||
@ -33,7 +34,11 @@ export const Tooltip = ({ label, children, ...props }: TooltipProps) => {
|
|||||||
<div
|
<div
|
||||||
{...props}
|
{...props}
|
||||||
{...attributes.popper}
|
{...attributes.popper}
|
||||||
className={clsx('py-1 px-2 m-1 text-sm bg-slate-900 rounded shadow-md', props.className)}
|
className={clsx(
|
||||||
|
'py-1 px-2 m-1 text-sm rounded shadow-md',
|
||||||
|
props.backgroundColor ? props.backgroundColor : 'bg-slate-900',
|
||||||
|
props.className,
|
||||||
|
)}
|
||||||
ref={setPopperElement}
|
ref={setPopperElement}
|
||||||
style={{ ...styles.popper, ...props.style }}
|
style={{ ...styles.popper, ...props.style }}
|
||||||
>
|
>
|
||||||
|
@ -19,6 +19,7 @@ import { BADGE_HUB_ADDRESS } from 'utils/constants'
|
|||||||
|
|
||||||
import { AddressInput, NumberInput, TextInput } from '../../forms/FormInput'
|
import { AddressInput, NumberInput, TextInput } from '../../forms/FormInput'
|
||||||
import { MetadataAttributes } from '../../forms/MetadataAttributes'
|
import { MetadataAttributes } from '../../forms/MetadataAttributes'
|
||||||
|
import { Tooltip } from '../../Tooltip'
|
||||||
import type { MintRule, UploadMethod } from './ImageUploadDetails'
|
import type { MintRule, UploadMethod } from './ImageUploadDetails'
|
||||||
|
|
||||||
interface BadgeDetailsProps {
|
interface BadgeDetailsProps {
|
||||||
@ -311,10 +312,17 @@ export const BadgeDetails = ({ metadataSize, onChange }: BadgeDetailsProps) => {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<Conditional test={managerState.value !== ''}>
|
<Conditional test={managerState.value !== ''}>
|
||||||
<div className="grid grid-cols-2 ml-12 w-full">
|
<Tooltip
|
||||||
<div className="mt-4 font-bold">Fee Estimate:</div>
|
backgroundColor="bg-stargaze"
|
||||||
<span className="mt-4">{(metadataSize * Number(metadataFeeRate)) / 1000000} stars</span>
|
className="bg-yellow-600"
|
||||||
</div>
|
label="This is only an estimate. Be sure to check the final amount before signing the transaction."
|
||||||
|
placement="bottom"
|
||||||
|
>
|
||||||
|
<div className="grid grid-cols-2 ml-12 w-full">
|
||||||
|
<div className="mt-4 font-bold">Fee Estimate:</div>
|
||||||
|
<span className="mt-4">{(metadataSize * Number(metadataFeeRate)) / 1000000} stars</span>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
</Conditional>
|
</Conditional>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user