1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00
This commit is contained in:
Matthias Kretschmann 2020-10-20 17:29:48 +02:00
parent 20e66cac9c
commit 9b55934994
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 34 additions and 29 deletions

View File

@ -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>
</>

View File

@ -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)