new api
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { useTheme } from './ThemeContext';
|
||||
|
||||
const ThemeButton = ({ children, onClick }) => {
|
||||
const { theme } = useTheme();
|
||||
|
||||
const buttonStyle = {
|
||||
backgroundColor: theme === 'light' ? '#fff' : '#333',
|
||||
color: theme === 'light' ? '#000' : '#fff',
|
||||
border: '1px solid #ccc',
|
||||
padding: '10px 20px',
|
||||
cursor: 'pointer',
|
||||
};
|
||||
|
||||
return (
|
||||
<button style={buttonStyle} onClick={onClick}>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default ThemeButton;
|
||||
Reference in New Issue
Block a user