mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
typing fixes
This commit is contained in:
parent
0497904bb5
commit
8d7eec69fa
@ -34,7 +34,7 @@ export default function FormPricing({
|
||||
useEffect(() => {
|
||||
const dtAmount = Number(price) * Number(weightOnDataToken)
|
||||
setFieldValue('dtAmount', dtAmount)
|
||||
}, [price])
|
||||
}, [price, weightOnDataToken])
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
|
@ -50,18 +50,20 @@ export default function Pricing({ ddo }: { ddo: DDO }): ReactElement {
|
||||
const data = useStaticQuery(query)
|
||||
const content = data.content.edges[0].node.childContentJson.create
|
||||
|
||||
// View states
|
||||
const [showPricing, setShowPricing] = useState(false)
|
||||
const [success, setSuccess] = useState<string>()
|
||||
|
||||
const {
|
||||
createPricing,
|
||||
pricingIsLoading,
|
||||
pricingError,
|
||||
pricingStepText
|
||||
} = usePricing(ddo)
|
||||
const [showPricing, setShowPricing] = useState(false)
|
||||
const [success, setSuccess] = useState<string>()
|
||||
|
||||
const hasFeedback = pricingIsLoading || success
|
||||
const hasFeedback = pricingIsLoading || typeof success !== 'undefined'
|
||||
|
||||
async function handleCreatePricing(values: Partial<PriceOptionsMarket>) {
|
||||
async function handleCreatePricing(values: PriceOptionsMarket) {
|
||||
try {
|
||||
const priceOptions = {
|
||||
...values,
|
||||
@ -78,7 +80,8 @@ export default function Pricing({ ddo }: { ddo: DDO }): ReactElement {
|
||||
}
|
||||
|
||||
// Pricing succeeded
|
||||
setSuccess(`🎉 Successfully created a ${values.type} price. 🎉`)
|
||||
setSuccess(`🎉 Successfully created a ${values.type} price. 🎉 `)
|
||||
Logger.log(`Transaction: ${tx}`)
|
||||
} catch (error) {
|
||||
toast.error(error.message)
|
||||
Logger.error(error.message)
|
||||
|
@ -15,7 +15,7 @@ export const validationSchema = Yup.object().shape<PriceOptionsMarket>({
|
||||
.nullable()
|
||||
})
|
||||
|
||||
export const initialValues: Partial<PriceOptionsMarket> = {
|
||||
export const initialValues: PriceOptionsMarket = {
|
||||
price: 1,
|
||||
type: 'dynamic',
|
||||
dtAmount: 1,
|
||||
|
Loading…
Reference in New Issue
Block a user