Add images and wow styles
This commit is contained in:
@@ -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>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user