-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
38 lines (34 loc) · 950 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react'
import styled, { createGlobalStyle } from 'styled-components'
import useCollabState from '../hooks/useCollabState'
const Global = createGlobalStyle`
* {
margin: 0px;
padding: 0px;
border: none;
}
`
const Menu = styled.div`
display: flex;
justify-content: center;
background-color: rgb(31, 32, 35);
`
export default function App () {
const [enabled, setEnabled] = useCollabState()
return (
<>
<Menu className='w-64 py-8'>
{enabled ? (
<button className='bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded' onClick={() => setEnabled(false)}>
Disable collab-mode
</button>
) : (
<button className='bg-indigo-500 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded' onClick={() => setEnabled(true)}>
Enable collab-mode
</button>
)}
</Menu>
<Global />
</>
)
}