1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 09:44:53 +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 Input from '../../../../atoms/Input'
import Error from './Error' 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({ export default function Fees({
tooltips tooltips
}: { }: {
@ -32,32 +56,16 @@ export default function Fees({
additionalComponent={<Error meta={meta} />} additionalComponent={<Error meta={meta} />}
/> />
<Input <Default
label={ title="Community Fee"
<>
Community Fee
<Tooltip content={tooltips.communityFee} />
</>
}
value="0.1"
name="communityFee" name="communityFee"
postfix="%" tooltip={tooltips.communityFee}
readOnly
small
/> />
<Input <Default
label={ title="Marketplace Fee"
<>
Marketplace Fee
<Tooltip content={tooltips.marketplaceFee} />
</>
}
value="0.1"
name="marketplaceFee" name="marketplaceFee"
postfix="%" tooltip={tooltips.marketplaceFee}
readOnly
small
/> />
</div> </div>
</> </>

View File

@ -53,21 +53,18 @@ export default function PublishPage({
) )
// Publish failed // Publish failed
if (publishError) { if (!ddo || publishError) {
setError(publishError) setError(publishError || 'Publishing DDO failed.')
Logger.error(publishError) Logger.error(publishError || 'Publishing DDO failed.')
return return
} }
if (!ddo) return
// Publish succeeded // Publish succeeded
setDdo(ddo) setDdo(ddo)
resetForm()
setSuccess( setSuccess(
'🎉 Successfully published. 🎉 Now create a price on your data set.' '🎉 Successfully published. 🎉 Now create a price on your data set.'
) )
resetForm()
} catch (error) { } catch (error) {
setError(error.message) setError(error.message)
Logger.error(error.message) Logger.error(error.message)