[react] feat: Added docs for components/Admin
This commit is contained in:
parent
6d9cbf55c2
commit
5ec2a2a1da
7 changed files with 255 additions and 70 deletions
|
@ -18,7 +18,13 @@ import { Markdown } from '@freesewing/react/components/Markdown'
|
||||||
import { ModalWrapper } from '@freesewing/react/components/Modal'
|
import { ModalWrapper } from '@freesewing/react/components/Modal'
|
||||||
import { AccountStatus, UserRole } from '@freesewing/react/components/Account'
|
import { AccountStatus, UserRole } from '@freesewing/react/components/Account'
|
||||||
|
|
||||||
export const SubscriberAdministration = ({ page }) => {
|
/**
|
||||||
|
* A component to manage FreeSewing newsletter subscribers (requires admin role)
|
||||||
|
*
|
||||||
|
* @component
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
|
export const SubscriberAdministration = () => {
|
||||||
const [subscribers, setSubscribers] = useState()
|
const [subscribers, setSubscribers] = useState()
|
||||||
const [q, setQ] = useState()
|
const [q, setQ] = useState()
|
||||||
const [hits, setHits] = useState([])
|
const [hits, setHits] = useState([])
|
||||||
|
@ -106,6 +112,14 @@ export const SubscriberAdministration = ({ page }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A component to manage FreeSewing users (requires the admin role)
|
||||||
|
*
|
||||||
|
* @component
|
||||||
|
* @param {object} props - All component props
|
||||||
|
* @param {React.Component} props.Link - A framework specific Link component for client-side routing
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
export const UserAdministration = ({ Link = false }) => {
|
export const UserAdministration = ({ Link = false }) => {
|
||||||
const backend = useBackend()
|
const backend = useBackend()
|
||||||
|
|
||||||
|
@ -154,7 +168,7 @@ export const UserAdministration = ({ Link = false }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Hits = ({ results, Link = false }) => {
|
const Hits = ({ results, Link = false }) => {
|
||||||
if (!Link) Link = WebLink
|
if (!Link) Link = WebLink
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -179,7 +193,7 @@ export const Hits = ({ results, Link = false }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const User = ({ user, Link }) => {
|
const User = ({ user, Link }) => {
|
||||||
const { setModal } = useContext(ModalContext)
|
const { setModal } = useContext(ModalContext)
|
||||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||||
const backend = useBackend()
|
const backend = useBackend()
|
||||||
|
@ -274,7 +288,7 @@ export const User = ({ user, Link }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ImpersonateButton = ({ userId }) => {
|
const ImpersonateButton = ({ userId }) => {
|
||||||
const backend = useBackend()
|
const backend = useBackend()
|
||||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||||
const { impersonate } = useAccount()
|
const { impersonate } = useAccount()
|
||||||
|
@ -300,14 +314,14 @@ export const ImpersonateButton = ({ userId }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Row = ({ title, val }) => (
|
const Row = ({ title, val }) => (
|
||||||
<tr className="py-1">
|
<tr className="py-1">
|
||||||
<td className="text-sm px-2 text-right font-bold">{title}</td>
|
<td className="text-sm px-2 text-right font-bold">{title}</td>
|
||||||
<td className="text-sm">{val}</td>
|
<td className="text-sm">{val}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
|
|
||||||
export const ManageUser = ({ userId }) => {
|
const ManageUser = ({ userId }) => {
|
||||||
// Hooks
|
// Hooks
|
||||||
const backend = useBackend()
|
const backend = useBackend()
|
||||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
mkdir -p ./docs/components
|
mkdir -p ./docs/components
|
||||||
|
|
||||||
jsdoc -c jsdoc.json components/Account/* > ../../sites/dev/prebuild/jsdoc/react/components/account.json
|
jsdoc -c jsdoc.json components/Account/* > ../../sites/dev/prebuild/jsdoc/react/components/account.json
|
||||||
|
jsdoc -c jsdoc.json components/Admin/* > ../../sites/dev/prebuild/jsdoc/react/components/admin.json
|
||||||
jsdoc -c jsdoc.json components/Button/* > ../../sites/dev/prebuild/jsdoc/react/components/button.json
|
jsdoc -c jsdoc.json components/Button/* > ../../sites/dev/prebuild/jsdoc/react/components/button.json
|
||||||
|
|
|
@ -21,6 +21,23 @@ import {
|
||||||
MsetCard,
|
MsetCard,
|
||||||
NewSet as NewSetExample,
|
NewSet as NewSetExample,
|
||||||
Newsletter as NewsletterExample,
|
Newsletter as NewsletterExample,
|
||||||
|
Password as PasswordExample,
|
||||||
|
Pattern,
|
||||||
|
PatternCard,
|
||||||
|
Patterns as PatternsExample,
|
||||||
|
Reddit as RedditExample,
|
||||||
|
Reload as ReloadExample,
|
||||||
|
Remove as RemoveExample,
|
||||||
|
Restrict as RestrictExample,
|
||||||
|
Set as SetExample,
|
||||||
|
Sets as SetsExample,
|
||||||
|
Tiktok as TiktokExample,
|
||||||
|
Twitch as TwitchExample,
|
||||||
|
Units as UnitsExample,
|
||||||
|
UserId as UserIdExample,
|
||||||
|
Username as UsernameExample,
|
||||||
|
UserRole as UserRoleExample,
|
||||||
|
Website as WebsiteExample,
|
||||||
} from '@freesewing/react/components/Account'
|
} from '@freesewing/react/components/Account'
|
||||||
|
|
||||||
const AccountStatusExample = () => (
|
const AccountStatusExample = () => (
|
||||||
|
@ -32,10 +49,30 @@ const AccountStatusExample = () => (
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>-2</td><td><AccountStatus status={-2} /></td></tr>
|
<tr>
|
||||||
<tr><td>-1</td><td><AccountStatus status={-1} /></td></tr>
|
<td>-2</td>
|
||||||
<tr><td>0</td><td><AccountStatus status={0} /></td></tr>
|
<td>
|
||||||
<tr><td>1</td><td><AccountStatus status={1} /></td></tr>
|
<AccountStatus status={-2} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>-1</td>
|
||||||
|
<td>
|
||||||
|
<AccountStatus status={-1} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0</td>
|
||||||
|
<td>
|
||||||
|
<AccountStatus status={0} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1</td>
|
||||||
|
<td>
|
||||||
|
<AccountStatus status={1} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
)
|
)
|
||||||
|
@ -48,9 +85,10 @@ const BookmarkButtonExample = () => (
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
const MsetCardExample = () => (
|
const MsetCardExample = () => <MsetCard set={{ name: 'Example Set' }} />
|
||||||
<MsetCard set={{ name: 'Example Set'}} />
|
|
||||||
)
|
const PatternExample = () => <Pattern id={1} />
|
||||||
|
const PatternCardExample = () => <PatternCard pattern={{ name: 'Example pattern' }} size="sm" />
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AccountStatusExample,
|
AccountStatusExample,
|
||||||
|
@ -74,5 +112,21 @@ export {
|
||||||
MsetCardExample,
|
MsetCardExample,
|
||||||
NewSetExample,
|
NewSetExample,
|
||||||
NewsletterExample,
|
NewsletterExample,
|
||||||
|
PasswordExample,
|
||||||
|
PatternExample,
|
||||||
|
PatternCardExample,
|
||||||
|
PatternsExample,
|
||||||
|
RedditExample,
|
||||||
|
ReloadExample,
|
||||||
|
RemoveExample,
|
||||||
|
RestrictExample,
|
||||||
|
SetExample,
|
||||||
|
SetsExample,
|
||||||
|
TiktokExample,
|
||||||
|
TwitchExample,
|
||||||
|
UnitsExample,
|
||||||
|
UserIdExample,
|
||||||
|
UsernameExample,
|
||||||
|
UserRoleExample,
|
||||||
|
WebsiteExample,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,23 @@ import {
|
||||||
jsdocMsetCard,
|
jsdocMsetCard,
|
||||||
jsdocNewSet,
|
jsdocNewSet,
|
||||||
jsdocNewsletter,
|
jsdocNewsletter,
|
||||||
|
jsdocPassword,
|
||||||
|
jsdocPattern,
|
||||||
|
jsdocPatternCard,
|
||||||
|
jsdocPatterns,
|
||||||
|
jsdocReddit,
|
||||||
|
jsdocReload,
|
||||||
|
jsdocRemove,
|
||||||
|
jsdocRestrict,
|
||||||
|
jsdocSet,
|
||||||
|
jsdocSets,
|
||||||
|
jsdocTiktok,
|
||||||
|
jsdocTwitch,
|
||||||
|
jsdocUnits,
|
||||||
|
jsdocUserId,
|
||||||
|
jsdocUsername,
|
||||||
|
jsdocUserRole,
|
||||||
|
jsdocWebsite,
|
||||||
} from '@site/prebuild/jsdoc/components.account.mjs'
|
} from '@site/prebuild/jsdoc/components.account.mjs'
|
||||||
import {
|
import {
|
||||||
AccountStatusExample,
|
AccountStatusExample,
|
||||||
|
@ -51,6 +68,23 @@ import {
|
||||||
MsetCardExample,
|
MsetCardExample,
|
||||||
NewSetExample,
|
NewSetExample,
|
||||||
NewsletterExample,
|
NewsletterExample,
|
||||||
|
PasswordExample,
|
||||||
|
PatternExample,
|
||||||
|
PatternCardExample,
|
||||||
|
PatternsExample,
|
||||||
|
RedditExample,
|
||||||
|
ReloadExample,
|
||||||
|
RemoveExample,
|
||||||
|
RestrictExample,
|
||||||
|
SetExample,
|
||||||
|
SetsExample,
|
||||||
|
TiktokExample,
|
||||||
|
TwitchExample,
|
||||||
|
UnitsExample,
|
||||||
|
UserIdExample,
|
||||||
|
UsernameExample,
|
||||||
|
UserRoleExample,
|
||||||
|
WebsiteExample,
|
||||||
} from './_examples.js'
|
} from './_examples.js'
|
||||||
|
|
||||||
<DocusaurusDoc>
|
<DocusaurusDoc>
|
||||||
|
@ -96,109 +130,162 @@ The **Account** component family provides the following components:
|
||||||
- [UserRole ](#userrole)
|
- [UserRole ](#userrole)
|
||||||
- [Website ](#website)
|
- [Website ](#website)
|
||||||
|
|
||||||
|
|
||||||
## AccountStatus
|
## AccountStatus
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocAccountStatus} example={AccountStatusExample} />
|
<ComponentDocs docs={jsdocAccountStatus} example={AccountStatusExample} />
|
||||||
|
|
||||||
## Apikeys
|
## Apikeys
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocApikeys} example={ApikeysExample} />
|
<ComponentDocs docs={jsdocApikeys} example={ApikeysExample} />
|
||||||
|
|
||||||
## Avatar
|
## Avatar
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocAvatar} example={AvatarExample} />
|
<ComponentDocs docs={jsdocAvatar} example={AvatarExample} />
|
||||||
|
|
||||||
## Bio
|
## Bio
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocBio} example={BioExample} />
|
<ComponentDocs docs={jsdocBio} example={BioExample} />
|
||||||
|
|
||||||
## BookmarkButton
|
## BookmarkButton
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocBookmarkButton} example={BookmarkButtonExample} />
|
<ComponentDocs docs={jsdocBookmarkButton} example={BookmarkButtonExample} />
|
||||||
|
|
||||||
## Bookmarks
|
## Bookmarks
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocBookmarks} example={BookmarksExample} />
|
<ComponentDocs docs={jsdocBookmarks} example={BookmarksExample} />
|
||||||
|
|
||||||
## Compare
|
## Compare
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocCompare} example={CompareExample} />
|
<ComponentDocs docs={jsdocCompare} example={CompareExample} />
|
||||||
|
|
||||||
## Consent
|
## Consent
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocConsent} example={ConsentExample} />
|
<ComponentDocs docs={jsdocConsent} example={ConsentExample} />
|
||||||
|
|
||||||
## Control
|
## Control
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocControl} example={ControlExample} />
|
<ComponentDocs docs={jsdocControl} example={ControlExample} />
|
||||||
|
|
||||||
## Email
|
## Email
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocEmail} example={EmailExample} />
|
<ComponentDocs docs={jsdocEmail} example={EmailExample} />
|
||||||
|
|
||||||
## EmailChangeConfirmation
|
## EmailChangeConfirmation
|
||||||
|
|
||||||
<MiniNote>
|
<MiniNote>
|
||||||
#### Requires a valid callback URL
|
#### Requires a valid callback URL This component will not work without the proper <code>id</code>{' '}
|
||||||
This component will not work without the proper <code>id</code> and <code>check</code> URL paramters
|
and <code>check</code> URL paramters that come from a email confirmation link sent out from the
|
||||||
that come from a email confirmation link sent out from the FreeSewing backend.
|
FreeSewing backend.
|
||||||
</MiniNote>
|
</MiniNote>
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocEmailChangeConfirmation} example={EmailChangeConfirmationExample} />
|
<ComponentDocs docs={jsdocEmailChangeConfirmation} example={EmailChangeConfirmationExample} />
|
||||||
|
|
||||||
## Export
|
## Export
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocExport} example={ExportExample} />
|
<ComponentDocs docs={jsdocExport} example={ExportExample} />
|
||||||
|
|
||||||
## Github
|
## Github
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocGithub} example={GithubExample} />
|
<ComponentDocs docs={jsdocGithub} example={GithubExample} />
|
||||||
|
|
||||||
## ImportSet
|
## ImportSet
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocImportSet} example={ImportSetExample} />
|
<ComponentDocs docs={jsdocImportSet} example={ImportSetExample} />
|
||||||
|
|
||||||
## Instagram
|
## Instagram
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocInstagram} example={InstagramExample} />
|
<ComponentDocs docs={jsdocInstagram} example={InstagramExample} />
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocLinks} example={LinksExample} />
|
<ComponentDocs docs={jsdocLinks} example={LinksExample} />
|
||||||
|
|
||||||
## Mastodon
|
## Mastodon
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocMastodon} example={MastodonExample} />
|
<ComponentDocs docs={jsdocMastodon} example={MastodonExample} />
|
||||||
|
|
||||||
## Mfa
|
## Mfa
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocMfa} example={MfaExample} />
|
<ComponentDocs docs={jsdocMfa} example={MfaExample} />
|
||||||
|
|
||||||
## MsetCard
|
## MsetCard
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocMsetCard} example={MsetCardExample} />
|
<ComponentDocs docs={jsdocMsetCard} example={MsetCardExample} />
|
||||||
|
|
||||||
## NewSet
|
## NewSet
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocNewSet} example={NewSetExample} />
|
<ComponentDocs docs={jsdocNewSet} example={NewSetExample} />
|
||||||
|
|
||||||
## Newsletter
|
## Newsletter
|
||||||
|
|
||||||
<ComponentDocs docs={jsdocNewsletter} example={NewsletterExample} />
|
<ComponentDocs docs={jsdocNewsletter} example={NewsletterExample} />
|
||||||
|
|
||||||
## Password
|
## Password
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocPassword} example={PasswordExample} />
|
||||||
|
|
||||||
## Pattern
|
## Pattern
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocPattern} example={PatternExample} />
|
||||||
|
|
||||||
## PatternCard
|
## PatternCard
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocPatternCard} example={PatternCardExample} />
|
||||||
|
|
||||||
## Patterns
|
## Patterns
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocPatterns} example={PatternsExample} />
|
||||||
|
|
||||||
## Reddit
|
## Reddit
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocReddit} example={RedditExample} />
|
||||||
|
|
||||||
## Reload
|
## Reload
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocReload} example={ReloadExample} />
|
||||||
|
|
||||||
## Remove
|
## Remove
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocRemove} example={RemoveExample} />
|
||||||
|
|
||||||
## Restrict
|
## Restrict
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocRestrict} example={RestrictExample} />
|
||||||
|
|
||||||
## Set
|
## Set
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocSet} example={SetExample} />
|
||||||
|
|
||||||
## Sets
|
## Sets
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocSets} example={SetsExample} />
|
||||||
|
|
||||||
## Tiktok
|
## Tiktok
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocTiktok} example={TiktokExample} />
|
||||||
|
|
||||||
## Twitch
|
## Twitch
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocTwitch} example={TwitchExample} />
|
||||||
|
|
||||||
## Units
|
## Units
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocUnits} example={UnitsExample} />
|
||||||
|
|
||||||
## UserId
|
## UserId
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocUserId} example={UserIdExample} />
|
||||||
|
|
||||||
## Username
|
## Username
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocUsername} example={UsernameExample} />
|
||||||
|
|
||||||
## UserRole
|
## UserRole
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocUserRole} example={UserRoleExample} />
|
||||||
|
|
||||||
## Website
|
## Website
|
||||||
|
|
||||||
</DocusaurusDoc>
|
<ComponentDocs docs={jsdocWebsite} example={WebsiteExample} />
|
||||||
|
|
||||||
|
</DocusaurusDoc>
|
||||||
|
|
|
@ -2,6 +2,31 @@
|
||||||
title: Admin
|
title: Admin
|
||||||
---
|
---
|
||||||
|
|
||||||
:::note
|
import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus'
|
||||||
This page is yet to be created
|
import { ComponentDocs } from '@site/src/components/component-docs.js'
|
||||||
:::
|
import {
|
||||||
|
jsdocSubscriberAdministration,
|
||||||
|
jsdocUserAdministration,
|
||||||
|
} from '@site/prebuild/jsdoc/components.admin.mjs'
|
||||||
|
import {
|
||||||
|
UserAdministration,
|
||||||
|
SubscriberAdministration
|
||||||
|
} from '@freesewing/react/components/Admin'
|
||||||
|
|
||||||
|
<DocusaurusDoc>
|
||||||
|
|
||||||
|
The **Admin** component family provides the following components:
|
||||||
|
|
||||||
|
- [SubscriberAdministration ](#subscriberadministration)
|
||||||
|
- [UserAdministration ](#useradministration)
|
||||||
|
|
||||||
|
## SubscriberAdministration
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocSubscriberAdministration} example={SubscriberAdministration} />
|
||||||
|
|
||||||
|
## UserAdministration
|
||||||
|
|
||||||
|
<ComponentDocs docs={jsdocUserAdministration} example={UserAdministration} />
|
||||||
|
|
||||||
|
</DocusaurusDoc>
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,7 @@ import { MiniNote } from '@freesewing/react/components/Mini'
|
||||||
|
|
||||||
export const IconButtonExample = () => (
|
export const IconButtonExample = () => (
|
||||||
<>
|
<>
|
||||||
<MiniNote>
|
<MiniNote>Note that this component will take up the full width made available to it.</MiniNote>
|
||||||
Note that this component will take up the full width made available to it.
|
|
||||||
</MiniNote>
|
|
||||||
<Highlight language="js">
|
<Highlight language="js">
|
||||||
{[
|
{[
|
||||||
`import { FingerprintIcon, WarningIcon } from '@freesewing/react/components/Icon'`,
|
`import { FingerprintIcon, WarningIcon } from '@freesewing/react/components/Icon'`,
|
||||||
|
@ -36,4 +34,3 @@ export const IconButtonExample = () => (
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { IconButton } from '@freesewing/react/components/Button'
|
||||||
import { MiniNote } from '@freesewing/react/components/Mini'
|
import { MiniNote } from '@freesewing/react/components/Mini'
|
||||||
|
|
||||||
export const ComponentDocs = ({ docs, example }) => {
|
export const ComponentDocs = ({ docs, example }) => {
|
||||||
|
if (!docs) return <MiniNote>No docs passed in</MiniNote>
|
||||||
const Example = example || null
|
const Example = example || null
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -19,10 +20,14 @@ export const ComponentDocs = ({ docs, example }) => {
|
||||||
<Highlight language="js">{docs.importAs}</Highlight>
|
<Highlight language="js">{docs.importAs}</Highlight>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab>
|
<Tab>
|
||||||
{docs.params
|
{docs.params ? (
|
||||||
? <p> The <code>{docs.name}</code> component takes the following props:</p>
|
<p>
|
||||||
: <MiniNote>This component does not take any props</MiniNote>
|
{' '}
|
||||||
}
|
The <code>{docs.name}</code> component takes the following props:
|
||||||
|
</p>
|
||||||
|
) : (
|
||||||
|
<MiniNote>This component does not take any props</MiniNote>
|
||||||
|
)}
|
||||||
{docs.params ? <PropsTable docs={docs} /> : null}
|
{docs.params ? <PropsTable docs={docs} /> : null}
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab>
|
<Tab>
|
||||||
|
@ -68,7 +73,9 @@ const PropsTable = ({ docs }) => (
|
||||||
<td>{prop.description}</td>
|
<td>{prop.description}</td>
|
||||||
<td>{prop.optional ? 'yes' : 'no'}</td>
|
<td>{prop.optional ? 'yes' : 'no'}</td>
|
||||||
<td>
|
<td>
|
||||||
<code><DefaultPropValue value={prop.defaultvalue} /></code>
|
<code>
|
||||||
|
<DefaultPropValue value={prop.defaultvalue} />
|
||||||
|
</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue