Skip to content

Commit

Permalink
refactor: added types to SideNavFooter (#14863)
Browse files Browse the repository at this point in the history
* refactor: mrigrate to ts

* fix: added description for each prop

---------

Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
k-rajat19 and tw15egan authored Oct 31, 2023
1 parent 486f583 commit ca13646
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@ import React from 'react';
import PropTypes from 'prop-types';
import { usePrefix } from '../../internal/usePrefix';

export interface SideNavFooterProps {
/**
* Provide text to be read to screen readers and shown as a tooltip when
* interacting with the toggle button in the footer
*/
assistiveText: string;

className?: string;

/**
* Specify whether the side navigation is expanded or collapsed
*/
expanded: boolean;

/**
* Provide a function that is called when the toggle button is interacted
* with. Useful for controlling the expansion state of the side navigation.
*/
onToggle: (event: React.MouseEvent<HTMLButtonElement>) => void;
}

/**
* SideNavFooter is used for rendering the button at the bottom of the side
* navigation that is a part of the UI Shell. It is responsible for handling the
Expand All @@ -22,7 +43,7 @@ function SideNavFooter({
className: customClassName,
expanded,
onToggle,
}) {
}: SideNavFooterProps) {
const prefix = usePrefix();
const className = cx(`${prefix}--side-nav__footer`, customClassName);
return (
Expand Down

0 comments on commit ca13646

Please sign in to comment.