| 1 |
import { render, useState } from '@wordpress/element'; |
| 2 |
import { Card, CardBody, Button } from '@wordpress/components'; |
| 3 |
import SignOutModal from './components/Modals/SignOutModal'; |
| 4 |
import './styles/settings.css'; |
| 5 |
|
| 6 |
function SettingsView() { |
| 7 |
const [isOpen, setOpen] = useState(false); |
| 8 |
const openModal = () => setOpen(true); |
| 9 |
const closeModal = () => setOpen(false); |
| 10 |
|
| 11 |
return ( |
| 12 |
<div className="root"> |
| 13 |
<h1 className="heading">Leadpages</h1> |
| 14 |
<h4>SETTINGS</h4> |
| 15 |
<Card className="settings-card"> |
| 16 |
<CardBody size="small"> |
| 17 |
<h3 className="account-header">Leadpages Account</h3> |
| 18 |
<Button variant="secondary" onClick={openModal}> |
| 19 |
Sign Out |
| 20 |
</Button> |
| 21 |
{isOpen && <SignOutModal onClose={closeModal} />} |
| 22 |
</CardBody> |
| 23 |
</Card> |
| 24 |
</div> |
| 25 |
); |
| 26 |
} |
| 27 |
|
| 28 |
export default SettingsView; |
| 29 |
|
| 30 |
window.addEventListener('load', () => render(<SettingsView />, document.getElementById('settings-page-root'))); |
| 31 |
|