Compare commits

...

3 Commits

@ -1,10 +1,16 @@
import Alert from "./components/Alert"; import { Button } from "./components/Button";
function handleOnClick() {
console.log("Clicked");
}
function App() { function App() {
return ( return (
<div> <div>
<Alert>Hello <strong>Marx</strong></Alert> <Button onClick={handleOnClick} color="success">My Button</Button>
</div> </div>
); );
} }

@ -0,0 +1,13 @@
interface Props {
children: string;
color?: 'primary' | 'secondary' | 'success';
onClick: () => void;
}
export const Button = ({ children, color='primary', onClick }: Props) => {
//const buttonType = "btn " + "btn"+"-"+{type};
return (
<button type="button" className={'btn btn-'+color} onClick={onClick}>{children}</button>
)
}
Loading…
Cancel
Save