Removed the open/close button from r3f

This commit is contained in:
Aria Minaei 2021-07-04 18:11:43 +02:00
parent d0c4dd4ec7
commit 532e24e691
3 changed files with 0 additions and 44 deletions

View file

@ -13,7 +13,6 @@ import studio from '@theatre/studio'
import {useVal} from '@theatre/dataverse-react' import {useVal} from '@theatre/dataverse-react'
import {IdProvider} from './elements/IdProvider' import {IdProvider} from './elements/IdProvider'
import PortalManager from './elements/PortalManager' import PortalManager from './elements/PortalManager'
import Button from './elements/Button'
const EditorScene = () => { const EditorScene = () => {
const orbitControlsRef = useRef<typeof OrbitControls>() const orbitControlsRef = useRef<typeof OrbitControls>()
@ -100,18 +99,6 @@ const Editor: VFC = () => {
</> </>
) : null} ) : null}
</div> </div>
{editorOpen || (
<Button
className="fixed bottom-5 left-5"
onClick={() => {
studio.transaction(({set}) => {
set(editorObject.props.isOpen, true)
})
}}
>
Editor
</Button>
)}
</div> </div>
<style type="text/css">{styles}</style> <style type="text/css">{styles}</style>

View file

@ -13,7 +13,6 @@ import studio from '@theatre/studio'
import {getSelected} from './useSelected' import {getSelected} from './useSelected'
import {useVal} from '@theatre/dataverse-react' import {useVal} from '@theatre/dataverse-react'
import IconButton from './elements/IconButton' import IconButton from './elements/IconButton'
import Button from './elements/Button'
const UI: VFC = () => { const UI: VFC = () => {
const [editorObject] = useEditorStore( const [editorObject] = useEditorStore(
@ -135,18 +134,6 @@ const UI: VFC = () => {
<ReferenceWindow height={referenceWindowSize} /> <ReferenceWindow height={referenceWindowSize} />
</div> </div>
</div> </div>
{/* Bottom-left corner*/}
<Button
className="absolute left-0 bottom-0 pointer-events-auto"
onClick={() =>
studio.transaction(({set}) => {
set(editorObject.props.isOpen, false)
})
}
>
Close
</Button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,18 +0,0 @@
import React, {forwardRef} from 'react'
import type {ButtonProps} from 'reakit'
import {Button as ButtonImpl} from 'reakit'
export type {ButtonProps}
const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
return (
<ButtonImpl
// @ts-ignore
ref={ref}
{...props}
className={`${props.className} inline-flex justify-center rounded-md px-4 py-2 font-medium bg-gray-100 text-gray-700 hover:bg-gray-200 focus:outline-none focus:ring focus:ring-blue-300`}
/>
)
})
export default Button