1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 09:44:53 +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 SuccessConfetti from '../../../atoms/SuccessConfetti'
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import styles from './Feedback.module.css' import styles from './Feedback.module.css'
import Button from '../../../atoms/Button'
export default function Feedback({ export default function Feedback({
success, success,
@ -10,10 +11,21 @@ export default function Feedback({
success: string success: string
pricingStepText: string pricingStepText: string
}): ReactElement { }): ReactElement {
const SuccessAction = () => (
<Button
style="primary"
size="small"
className={styles.action}
onClick={() => window?.location.reload()}
>
Reload Page
</Button>
)
return ( return (
<div className={styles.feedback}> <div className={styles.feedback}>
{success ? ( {success ? (
<SuccessConfetti success={success} /> <SuccessConfetti success={success} action={<SuccessAction />} />
) : ( ) : (
<Loader message={pricingStepText} /> <Loader message={pricingStepText} />
)} )}

View File

@ -84,7 +84,9 @@ export default function Pricing({ ddo }: { ddo: DDO }): ReactElement {
} }
// Pricing succeeded // 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}`) Logger.log(`Transaction: ${tx}`)
} catch (error) { } catch (error) {
toast.error(error.message) toast.error(error.message)