Skip to content

Commit

Permalink
[Penify]: Documentation for commit - f390789 (#6)
Browse files Browse the repository at this point in the history
* [Penify]: Documentation for commit - f390789

* [Penify]: Documentation for commit - f390789

---------

Co-authored-by: penify-dev[bot] <146478655+penify-dev[bot]@users.noreply.github.com>
  • Loading branch information
penify-dev[bot] authored Oct 10, 2024
1 parent f390789 commit aea8d95
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ const FeatureList: FeatureItem[] = [
},
];

/**
* Renders a feature component displaying an SVG icon, title, and description.
*
* @param {Object} params - The parameters for the feature component.
* @param {string} params.title - The title of the feature.
* @param {React.ComponentType} params.Svg - The SVG component to be displayed.
* @param {string} params.description - A brief description of the feature.
*
* @returns {JSX.Element} The rendered feature component.
*
* @example
* const MyFeature = () => (
* <Feature
* title="Feature Title"
* Svg={MySvgIcon}
* description="This is a description of the feature."
* />
* );
*
* @throws {Error} Throws an error if the title or description is not provided.
*/
function Feature({title, Svg, description}: FeatureItem) {
return (
<div className={clsx('col col--4')}>
Expand All @@ -55,6 +76,23 @@ function Feature({title, Svg, description}: FeatureItem) {
);
}

/**
* Renders the homepage features section.
*
* This function is a React functional component that generates a section
* containing a list of features. Each feature is rendered using the
* `Feature` component, which receives its properties from the `FeatureList`.
*
* @returns {JSX.Element} A JSX element representing the features section.
*
* @example
* // Example usage of HomepageFeatures in a parent component
* const App = () => (
* <div>
* <HomepageFeatures />
* </div>
* );
*/
export default function HomepageFeatures(): JSX.Element {
return (
<section className={styles.features}>
Expand Down
31 changes: 31 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ import Heading from '@theme/Heading';

import styles from './index.module.css';

/**
* Renders the header section of the homepage.
* This component displays the site's title and tagline, along with a button
* that links to the Docusaurus tutorial.
*
* @returns {JSX.Element} The rendered header component.
*
* @example
* // Usage in a React component
* return (
* <HomepageHeader />
* );
*
* @throws {Error} Throws an error if the site configuration is not available.
*/
function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
return (
Expand All @@ -28,6 +43,22 @@ function HomepageHeader() {
);
}

/**
* Renders the home page of the application.
*
* This function utilizes the Docusaurus context to retrieve the site configuration
* and displays the homepage layout, including a header and features section.
*
* @returns {JSX.Element} The rendered home page component.
*
* @example
* // To use the Home component in your application:
* import Home from './path/to/Home';
*
* function App() {
* return <Home />;
* }
*/
export default function Home(): JSX.Element {
const {siteConfig} = useDocusaurusContext();
return (
Expand Down

0 comments on commit aea8d95

Please sign in to comment.