From c2dafc1e61614445d0ba3b8da5f3f24c571eadfd Mon Sep 17 00:00:00 2001 From: sunil25393 Date: Wed, 29 May 2024 18:38:16 +0530 Subject: [PATCH] Added doc for PostSlug components --- packages/editor/README.md | 17 +++++++++++++++-- .../editor/src/components/post-slug/check.js | 8 ++++++++ .../editor/src/components/post-slug/index.js | 5 +++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/packages/editor/README.md b/packages/editor/README.md index f25cab506df1e..c3f3f2621c048 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -1181,11 +1181,24 @@ _Returns_ ### PostSlug -Undocumented declaration. +Renders the PostSlug component. It provide a control for editing the post slug. + +_Returns_ + +- `Component`: The component to be rendered. ### PostSlugCheck -Undocumented declaration. +Wrapper component that renders its children only if the post type supports the slug. + +_Parameters_ + +- _props_ `Object`: Props. +- _props.children_ `Element`: Children to be rendered. + +_Returns_ + +- `Component`: The component to be rendered. ### PostSticky diff --git a/packages/editor/src/components/post-slug/check.js b/packages/editor/src/components/post-slug/check.js index 80928e4cf1dec..86bf04814c934 100644 --- a/packages/editor/src/components/post-slug/check.js +++ b/packages/editor/src/components/post-slug/check.js @@ -3,6 +3,14 @@ */ import PostTypeSupportCheck from '../post-type-support-check'; +/** + * Wrapper component that renders its children only if the post type supports the slug. + * + * @param {Object} props Props. + * @param {Element} props.children Children to be rendered. + * + * @return {Component} The component to be rendered. + */ export default function PostSlugCheck( { children } ) { return ( diff --git a/packages/editor/src/components/post-slug/index.js b/packages/editor/src/components/post-slug/index.js index 343816dbd2ef4..cc86405157b88 100644 --- a/packages/editor/src/components/post-slug/index.js +++ b/packages/editor/src/components/post-slug/index.js @@ -58,6 +58,11 @@ function PostSlugControl() { ); } +/** + * Renders the PostSlug component. It provide a control for editing the post slug. + * + * @return {Component} The component to be rendered. + */ export default function PostSlug() { return (