mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 09:11:57 +10:00
- building the base modal trigger architecture
This commit is contained in:
@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user