1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-29 00:57:50 +02:00
market/src/components/templates/Page.tsx
Jamie Hewitt e26ed0e81a
Issue 582 market rbac integration (#597)
* adding env for RBAC server url to app.config.js

* creating util function for requesting auth from the rbac server

* fixing typing error

* testing rbac request on homepage

* removing console logs

* importing RBAC url from config file

* creating develpment .env file

* return true if no rbac url env is set

* creating permissions parent component

* wrapping homepage content in permission element

* wrapping publish in permissions wrapper

* wrapping search results in permissions wrapper

* wrapping asset actions in permissions element

* creating an error alert for permission denied

* updating react hook dependency

* passing address to rbac component

* sedning address to RBAC server

* wrapping asset in permission component

* removing unused import of Permission component

* sending request based on address

* chaning default permission case to restrict access

* updating eventType as consume

* Adding loader icon while waiting form permission response

* only sending request to RBAC if address is defined

* adding wallet connection info message

* changing the env name and checking for undefined

* updating .env.development

* Check for undefined RBAC_URL in permissions component

* removing .env.development and updating .env.example

* updating .env.example comment

* switching alert messages and reducing return statements

* removing console.log message

* fixing linting issue

* Revert "fixing linting issue"

This reverts commit 8bcb80be3d.

* Fixing linting errors

* pull from origin main

* Revert "pull from origin main"

This reverts commit 9535e41a5f.
2021-06-10 12:06:26 +03:00

39 lines
804 B
TypeScript

import React, { ReactNode, ReactElement } from 'react'
import PageHeader from '../molecules/PageHeader'
import Seo from '../atoms/Seo'
import Container from '../atoms/Container'
export interface PageProps {
children: ReactNode
title: string
uri: string
description?: string
noPageHeader?: boolean
headerCenter?: boolean
}
export default function Page({
children,
title,
uri,
description,
noPageHeader,
headerCenter
}: PageProps): ReactElement {
return (
<>
<Seo title={title} description={description} uri={uri} />
<Container>
{title && !noPageHeader && (
<PageHeader
title={title}
description={description}
center={headerCenter}
/>
)}
{children}
</Container>
</>
)
}