mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-19 23:28:23 -04:00
Add sample button component (#541)
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
import React from 'react';
|
||||
import '../styles/tailwind.css';
|
||||
import Button from './Button';
|
||||
|
||||
const App: React.FC = () => {
|
||||
const handleClick = () => {
|
||||
alert('Button clicked!');
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-blue-500 text-white p-4">
|
||||
<h1>Hello, AliasVault Chrome Extension!</h1>
|
||||
<div className="mt-4">
|
||||
<Button onClick={handleClick}>
|
||||
Click me!
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
19
browser-extensions/chrome/src/components/Button.tsx
Normal file
19
browser-extensions/chrome/src/components/Button.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
|
||||
interface ButtonProps {
|
||||
onClick: () => void;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const Button: React.FC<ButtonProps> = ({ onClick, children }) => {
|
||||
return (
|
||||
<button
|
||||
className="bg-white text-blue-500 px-4 py-2 rounded hover:bg-blue-100 transition-colors"
|
||||
onClick={onClick}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default Button;
|
||||
Reference in New Issue
Block a user