Add images and wow styles

This commit is contained in:
obergodmar
2020-06-23 01:53:34 +03:00
parent 00e142bf09
commit 98a307f2cc
24 changed files with 259 additions and 21 deletions
@@ -1,5 +1,5 @@
import * as React from 'react'
import { useCallback } from 'react'
import { useCallback, useEffect, useState } from 'react'
import './panel-component.scss'
@@ -7,9 +7,15 @@ interface Props {
orientation: 'bottom' | 'left'
isShown: boolean
setShown: () => void
children: React.ReactNode
}
export const PanelComponent = ({orientation, isShown, setShown}: Props) => {
export const PanelComponent = ({orientation, isShown, setShown, children}: Props) => {
const [isRendered, setRendered] = useState(false)
useEffect(() => {
setRendered(isShown)
}, [isShown])
const handleClick = useCallback((event) => {
event.preventDefault()
@@ -20,6 +26,8 @@ export const PanelComponent = ({orientation, isShown, setShown}: Props) => {
<div
className={`panel panel--${orientation} ${isShown ? `panel--${orientation}--shown` : ''}`}
>
<div className='panel-border'/>
{isRendered && children}
<button onClick={handleClick}/>
</div>
)