[react] feat: Added docs for components/Role
This commit is contained in:
parent
d6cbe79dd5
commit
7093dd3d36
5 changed files with 69 additions and 8 deletions
|
@ -13,7 +13,7 @@ import { AvatarExample, OwnProfileExample, UserProfileExample } from './_example
|
|||
|
||||
## Components
|
||||
|
||||
The **Json** component family provides the following components:
|
||||
The **Profile** component family provides the following components:
|
||||
|
||||
- [Avatar](#avatar)
|
||||
- [OwnProfile](#ownprofile)
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import React from 'react'
|
||||
import { RoleBlock, UserVisitorContent } from '@freesewing/react/components/Role'
|
||||
|
||||
export const RoleBlockExample = () => (
|
||||
<RoleBlock role="admin">
|
||||
<p>Wow, you are an admin! This content is admin-only.</p>
|
||||
</RoleBlock>
|
||||
)
|
||||
|
||||
export const UserVisitorContentExample = () => (
|
||||
<UserVisitorContent
|
||||
userContent={<p>You are a user. This content is only for users.</p>}
|
||||
visitorContent={<p>You are a visitor. This content is only for visitors.</p>}
|
||||
/>
|
||||
)
|
|
@ -2,6 +2,28 @@
|
|||
title: Role
|
||||
---
|
||||
|
||||
:::note
|
||||
This page is yet to be created
|
||||
:::
|
||||
import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus'
|
||||
import { ComponentDocs } from '@site/src/components/component-docs.js'
|
||||
import * as jsdoc from '@site/prebuild/jsdoc/components.role.mjs'
|
||||
import { RoleBlockExample, UserVisitorContentExample } from './_examples.js'
|
||||
|
||||
<DocusaurusDoc>
|
||||
|
||||
- [Components](#components)
|
||||
|
||||
## Components
|
||||
|
||||
The **Role** component family provides the following components:
|
||||
|
||||
- [RoleBlock](#roleblock)
|
||||
- [UserVisitorContent](#uservisitorcontent)
|
||||
|
||||
### RoleBlock
|
||||
|
||||
<ComponentDocs docs={jsdoc.jsdocRoleBlock} example={RoleBlockExample} />
|
||||
|
||||
### UserVisitorContent
|
||||
|
||||
<ComponentDocs docs={jsdoc.jsdocUserVisitorContent} example={UserVisitorContentExample} />
|
||||
|
||||
</DocusaurusDoc>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue