- building the base modal trigger architecture

This commit is contained in:
Amruth Pillai
2020-07-03 15:48:55 +05:30
parent 70ef926b70
commit 336fd22150
9 changed files with 341 additions and 9 deletions

View File

@ -3,17 +3,27 @@ import classNames from "classnames";
import Loader from "react-loader-spinner";
import styles from "./Button.module.css";
const Button = ({ text, isLoading, outline, className }) => {
const getClasses = classNames(styles.container, className, {
const Button = ({ title, isLoading, onClick, outline, className }) => {
const classes = classNames(styles.container, className, {
[styles.outline]: outline,
});
const handleKeyDown = (e) => {
console.log(e.key);
};
return (
<div className={getClasses}>
<div
tabIndex="0"
role="button"
onClick={onClick}
className={classes}
onKeyDown={handleKeyDown}
>
{isLoading ? (
<Loader type="ThreeDots" color="#FFF" height={18} width={28} />
) : (
text
title
)}
</div>
);