diff --git a/packages/atlas/src/components/_crt/StartRevenueShareModal/StartRevenueShareModal.tsx b/packages/atlas/src/components/_crt/StartRevenueShareModal/StartRevenueShareModal.tsx index bffffdc62b..e1cd638ffc 100644 --- a/packages/atlas/src/components/_crt/StartRevenueShareModal/StartRevenueShareModal.tsx +++ b/packages/atlas/src/components/_crt/StartRevenueShareModal/StartRevenueShareModal.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled' -import { useCallback, useMemo, useState } from 'react' +import { useCallback, useMemo } from 'react' import { Controller, useForm } from 'react-hook-form' import { FlexBox } from '@/components/FlexBox/FlexBox' @@ -41,7 +41,6 @@ const datePickerItemsFactory = (days: number[]) => const endDateItems = datePickerItemsFactory([7, 14, 30]) export const StartRevenueShare = ({ tokenId, onClose, show }: SellTokenModalProps) => { - const [tokens, setTokens] = useState(null) const smMatch = useMediaMatch('sm') const { patronageRate, userBalance, title } = getTokenDetails(tokenId) @@ -51,6 +50,7 @@ export const StartRevenueShare = ({ tokenId, onClose, show }: SellTokenModalProp endDate: AuctionDatePickerProps['value'] | null }>() const { trigger, control, watch } = form + const [startDate, endDate, tokens] = watch(['startDate', 'endDate', 'tokens']) const details = useMemo( () => [ @@ -58,7 +58,7 @@ export const StartRevenueShare = ({ tokenId, onClose, show }: SellTokenModalProp title: 'You will receive', content: ( - + ({Math.round(patronageRate * 100)}%) @@ -66,18 +66,18 @@ export const StartRevenueShare = ({ tokenId, onClose, show }: SellTokenModalProp ), }, { - title: 'You will spend', + title: 'Your holders will receive', content: ( - ( {Math.round(1 - patronageRate) * 100}%) + ( {Math.round((1 - patronageRate) * 100)}%) ), @@ -86,8 +86,6 @@ export const StartRevenueShare = ({ tokenId, onClose, show }: SellTokenModalProp [patronageRate, tokens] ) - const [startDate, endDate] = watch(['startDate', 'endDate']) - const selectDurationToDate = useCallback((value: AuctionDatePickerProps['value'], base?: Date) => { if (value?.type === 'date') { return value.date @@ -121,24 +119,30 @@ export const StartRevenueShare = ({ tokenId, onClose, show }: SellTokenModalProp withDenomination /> - - - - $0.00 - - Max - - } - /> - + ( + + + + $0.00 + + Max + + } + /> + + )} + /> {details.map((row) => (