Skip to content

Commit

Permalink
Fix CustomPage type
Browse files Browse the repository at this point in the history
  • Loading branch information
anagstef committed Oct 9, 2023
1 parent 8a1ba73 commit 62d215e
Showing 1 changed file with 9 additions and 37 deletions.
46 changes: 9 additions & 37 deletions docs/references/javascript/types/custom-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,15 @@ description: Custom page for UserProfile or OrganizationProfile

# `CustomPage`

Custom page for UserProfile or OrganizationProfile.
Custom page for `UserProfile` or `OrganizationProfile`.

## Attributes

<Tables
headings={["Name", "Type", "Description"]}
headingsMeta={[{maxWidth:'300px'},{maxWidth: '300px'},{maxWidth: '300px'}]}
rows={[
{cells: [
<code>label</code>,
<code>string</code>,
"The label of the custom page. It is a required property."
]},
{cells: [
<code>url</code>,
<code>string | undefined</code>,
"The path segment that will be used to navigate to the custom page. It should be relative when providing a custom page and absolute when providing a custom link."
]},
{cells: [
<code>mountIcon</code>,
<code>((el: [`HTMLDivElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement)) ={">"} void) | undefined</code>,
"This function is called to mount the icon of the label. The `el` argument is the element where the icon should be mounted."
]},
{cells: [
<code>unmountIcon</code>,
<code>((el?: [`HTMLDivElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement)) ={">"} void) | undefined</code>,
"This function is called to unmount the icon of the label. The `el` argument is the same element that was passed to the `mountIcon` function."
]},
{cells: [
<code>mount</code>,
<code>((el: [`HTMLDivElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement)) ={">"} void) | undefined</code>,
"This function is called to mount the content of the custom page. The `el` argument is the element where the content should be mounted."
]},
{cells: [
<code>unmount</code>,
<code>((el?: [`HTMLDivElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement)) ={">"} void) | undefined</code>,
"This function is called to unmount the content of the custom page. The `el` argument is the same element that was passed to the `mount` function."
]},
]}
/>
| Name | Type | Description |
| --- | --- | --- |
| `label` | `string` | The label of the custom page. It is a required property. |
| `url` | `string \| undefined` | The path segment that will be used to navigate to the custom page. It should be relative when providing a custom page and absolute when providing a custom link. |
| `mountIcon` | `((el: HTMLDivElement) => void) \| undefined` | This function is called to mount the icon of the label. The `el` argument is the element where the icon should be mounted. |
| `unmountIcon` | `((el?: HTMLDivElement) => void) \| undefined` | This function is called to unmount the icon of the label. The `el` argument is the same element that was passed to the `mountIcon` function. |
| `mount` | `((el: HTMLDivElement) => void) \| undefined` | This function is called to mount the content of the custom page. The `el` argument is the element where the content should be mounted. |
| `unmount` | `((el?: HTMLDivElement) => void) \| undefined` | This function is called to unmount the content of the custom page. The `el` argument is the same element that was passed to the `mount` function. |

0 comments on commit 62d215e

Please sign in to comment.