Skip to content

Commit

Permalink
[web][doc] Small fixes/improvements on core/Page doc
Browse files Browse the repository at this point in the history
Some core/Page documentation was sent with mistakes in
#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.
  • Loading branch information
dgdavid committed Jan 8, 2024
1 parent 6edbeed commit 8fa1935
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web/src/components/core/Page.jsx
Expand Up @@ -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}</>;

Expand All @@ -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 = () => {
Expand All @@ -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 (
Expand Down

0 comments on commit 8fa1935

Please sign in to comment.