1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

force reload button

This commit is contained in:
Matthias Kretschmann 2020-10-21 17:19:29 +02:00
parent 89709cbe73
commit 47381639ff
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 16 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import Loader from '../../../atoms/Loader'
import SuccessConfetti from '../../../atoms/SuccessConfetti'
import React, { ReactElement } from 'react'
import styles from './Feedback.module.css'
import Button from '../../../atoms/Button'
export default function Feedback({
success,
@ -10,10 +11,21 @@ export default function Feedback({
success: string
pricingStepText: string
}): ReactElement {
const SuccessAction = () => (
<Button
style="primary"
size="small"
className={styles.action}
onClick={() => window?.location.reload()}
>
Reload Page
</Button>
)
return (
<div className={styles.feedback}>
{success ? (
<SuccessConfetti success={success} />
<SuccessConfetti success={success} action={<SuccessAction />} />
) : (
<Loader message={pricingStepText} />
)}

View File

@ -84,7 +84,9 @@ export default function Pricing({ ddo }: { ddo: DDO }): ReactElement {
}
// Pricing succeeded
setSuccess(`🎉 Successfully created a ${values.type} price. 🎉 `)
setSuccess(
`🎉 Successfully created a ${values.type} price. 🎉 Reload the page to get all updates.`
)
Logger.log(`Transaction: ${tx}`)
} catch (error) {
toast.error(error.message)