Admin

The Admin component should wrap all the components used in the Admin Dashboard, which are:

It manages authentication and renders the Admin menu. It acts also as a Provider for the AdminContext, making it available to the wrapped components.

Props

interface AdminProps {
isLogin?: boolean
}

The only prop you can specify is isLogin.
It is a boolean value to identify the Login page. It is needed to correctly manage the authentication process.

Usage example, editor page

import React from 'react'
import { Admin, Editor } from 'react-bricks'
const EditorPage = () => {
return (
<Admin>
<Editor />
</Admin>
)
}
export default EditorPage

Usage example, login page

import React from 'react'
import { Admin, Login } from 'react-bricks'
const LoginPage = () => {
return (
<Admin isLogin>
<Login />
</Admin>
)
}
export default LoginPage