From 8fa193536ba38dfe6a6b93c6cfe8e2d5ca38ad78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Mon, 8 Jan 2024 19:38:37 +0000 Subject: [PATCH] [web][doc] Small fixes/improvements on core/Page doc Some core/Page documentation was sent with mistakes in https://github.com/openSUSE/agama/pull/925. This commit fixes the mistakes, although it does not introduce big improvements because it is already out of the scope of the PR in which is sent. --- web/src/components/core/Page.jsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/web/src/components/core/Page.jsx b/web/src/components/core/Page.jsx index 72123d843..8d57e1ea8 100644 --- a/web/src/components/core/Page.jsx +++ b/web/src/components/core/Page.jsx @@ -37,7 +37,8 @@ import logoUrl from "~/assets/suse-horizontal-logo.svg"; * * @see Page examples. * - * @param {React.ReactNode} [props.children] - a collection of Action components + * @param {object} [props] - component props + * @param {React.ReactNode} [props.children] - components to be rendered as actions */ const Actions = ({ children }) => <>{children}; @@ -58,10 +59,13 @@ const Menu = PageMenu; * * @see Page examples. * - * @param {React.ReactNode} props.children - content of the action - * @param {object} [props] - PF/Button props, see {@link https://www.patternfly.org/components/button#props} + * @param {object} [props] - Component props. + * @param {function} [props.onClick] - Callback to be triggered when action is clicked. + * @param {string} [props.navigateTo] - Route to navigate after triggering the onClick callback, if given. + * @param {React.ReactNode} props.children - Content of the action. + * @param {object} [props.props] - other props passed down to the internal PF/Button. See {@link https://www.patternfly.org/components/button/#button}. */ -const Action = ({ children, navigateTo, onClick, ...props }) => { +const Action = ({ navigateTo, onClick, children, ...props }) => { const navigate = useNavigate(); props.onClick = () => { @@ -82,9 +86,6 @@ const Action = ({ children, navigateTo, onClick, ...props }) => { * TODO: Explain below note better * @note that we cannot use navigate("..") because our routes are all nested in * the root. - * - * @param {React.ReactNode} props.children - content of the action - * @param {object} [props] - {@link Action} props */ const BackAction = () => { return (