1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Adding loader icon while waiting form permission response

This commit is contained in:
Jamie Hewitt 2021-06-01 17:54:35 +03:00
parent 20361578ca
commit 3451aac42e

View File

@ -2,6 +2,7 @@ import React, { ReactElement, useEffect, useState } from 'react'
import { useWeb3 } from '../../providers/Web3' import { useWeb3 } from '../../providers/Web3'
import rbacRequest from '../../utils/rbac' import rbacRequest from '../../utils/rbac'
import Alert from '../atoms/Alert' import Alert from '../atoms/Alert'
import Loader from '../atoms/Loader'
export default function Permission({ export default function Permission({
eventType, eventType,
@ -22,8 +23,10 @@ export default function Permission({
console.log('eventType', eventType) console.log('eventType', eventType)
if (data === true) { if (data === true) {
return <>{children}</> return <>{children}</>
} else { } else if (data === false) {
const message = `Sorry, you don't have permission to ${eventType}. Please make sure you are logged in.` const message = `Sorry, you don't have permission to ${eventType}. Please make sure you are logged in.`
return <Alert title="Permission denied" text={message} state="error" /> return <Alert title="Permission denied" text={message} state="error" />
} else {
return <Loader />
} }
} }