Skip to content

Commit

Permalink
Add more detailed documentations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Excleson committed Jul 3, 2023
1 parent 6935a76 commit f11790f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions components/Buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';

/**
* Button property
* AButton component's props definitions.
*/
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
text: string
// Add your custom properties here.
}

/**
* Default style for buttons using Tailwind CSS
* Default style for buttons using Tailwind CSS.
*/
const buttonStyle = "text-white font-bold py-2 px-4 rounded";

Expand All @@ -20,10 +20,10 @@ const cancelColor = "bg-red-500 hover:bg-red-700 ";
const disabledButton = " opacity-50 cursor-not-allowed";

/**
* Function for get button style
* @param buttonType type for the button (reset | submit | cancel)
* @param disabled is the button disabled (true | false)
* @returns style for the button
* Function for conditionally assigning the button's style.
* @param buttonType Type for the button (reset | submit | cancel)
* @param disabled The disabled flag for marking the button disabled state. (true | false).
* @returns Named class name for the button component.
*/
function getButtonClassNames(buttonType?: string, disabled?: boolean): string {
let className: string;
Expand All @@ -39,6 +39,9 @@ function getButtonClassNames(buttonType?: string, disabled?: boolean): string {
return className;
}

/**
* AButton component definitions.
*/
export const AButton: React.FC<ButtonProps> = (
props
) => {
Expand Down

0 comments on commit f11790f

Please sign in to comment.