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

wrapping asset actions in permissions element

This commit is contained in:
Jamie Hewitt 2021-05-20 17:31:25 +03:00
parent adb5a2fdc3
commit 6d037abeec
2 changed files with 22 additions and 14 deletions

View File

@ -1,4 +1,5 @@
import React, { ReactElement, useState, useEffect } from 'react'
import Permission from '../Permission'
import styles from './index.module.css'
import Compute from './Compute'
import Consume from './Consume'
@ -89,5 +90,9 @@ export default function AssetActions(): ReactElement {
}
)
return <Tabs items={tabs} className={styles.actions} />
return (
<Permission eventType="purchase">
<Tabs items={tabs} className={styles.actions} />
</Permission>
)
}

View File

@ -1,4 +1,5 @@
import React, { ReactNode, ReactElement } from 'react'
import Permission from '../organisms/Permission'
import PageHeader from '../molecules/PageHeader'
import Seo from '../atoms/Seo'
import Container from '../atoms/Container'
@ -21,19 +22,21 @@ export default function Page({
headerCenter
}: PageProps): ReactElement {
return (
<>
<Seo title={title} description={description} uri={uri} />
<Permission eventType="browse">
<>
<Seo title={title} description={description} uri={uri} />
<Container>
{title && !noPageHeader && (
<PageHeader
title={title}
description={description}
center={headerCenter}
/>
)}
{children}
</Container>
</>
<Container>
{title && !noPageHeader && (
<PageHeader
title={title}
description={description}
center={headerCenter}
/>
)}
{children}
</Container>
</>
</Permission>
)
}