mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
refactor
This commit is contained in:
parent
20e66cac9c
commit
9b55934994
@ -5,6 +5,30 @@ import { useField } from 'formik'
|
||||
import Input from '../../../../atoms/Input'
|
||||
import Error from './Error'
|
||||
|
||||
const Default = ({
|
||||
title,
|
||||
name,
|
||||
tooltip
|
||||
}: {
|
||||
title: string
|
||||
name: string
|
||||
tooltip: string
|
||||
}) => (
|
||||
<Input
|
||||
label={
|
||||
<>
|
||||
{title}
|
||||
<Tooltip content={tooltip} />
|
||||
</>
|
||||
}
|
||||
value="0.1"
|
||||
name={name}
|
||||
postfix="%"
|
||||
readOnly
|
||||
small
|
||||
/>
|
||||
)
|
||||
|
||||
export default function Fees({
|
||||
tooltips
|
||||
}: {
|
||||
@ -32,32 +56,16 @@ export default function Fees({
|
||||
additionalComponent={<Error meta={meta} />}
|
||||
/>
|
||||
|
||||
<Input
|
||||
label={
|
||||
<>
|
||||
Community Fee
|
||||
<Tooltip content={tooltips.communityFee} />
|
||||
</>
|
||||
}
|
||||
value="0.1"
|
||||
<Default
|
||||
title="Community Fee"
|
||||
name="communityFee"
|
||||
postfix="%"
|
||||
readOnly
|
||||
small
|
||||
tooltip={tooltips.communityFee}
|
||||
/>
|
||||
|
||||
<Input
|
||||
label={
|
||||
<>
|
||||
Marketplace Fee
|
||||
<Tooltip content={tooltips.marketplaceFee} />
|
||||
</>
|
||||
}
|
||||
value="0.1"
|
||||
<Default
|
||||
title="Marketplace Fee"
|
||||
name="marketplaceFee"
|
||||
postfix="%"
|
||||
readOnly
|
||||
small
|
||||
tooltip={tooltips.marketplaceFee}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
@ -53,21 +53,18 @@ export default function PublishPage({
|
||||
)
|
||||
|
||||
// Publish failed
|
||||
if (publishError) {
|
||||
setError(publishError)
|
||||
Logger.error(publishError)
|
||||
if (!ddo || publishError) {
|
||||
setError(publishError || 'Publishing DDO failed.')
|
||||
Logger.error(publishError || 'Publishing DDO failed.')
|
||||
return
|
||||
}
|
||||
|
||||
if (!ddo) return
|
||||
|
||||
// Publish succeeded
|
||||
setDdo(ddo)
|
||||
resetForm()
|
||||
|
||||
setSuccess(
|
||||
'🎉 Successfully published. 🎉 Now create a price on your data set.'
|
||||
)
|
||||
resetForm()
|
||||
} catch (error) {
|
||||
setError(error.message)
|
||||
Logger.error(error.message)
|
||||
|
Loading…
Reference in New Issue
Block a user