File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
explorer/components/DrawingPage Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,18 @@ import React from 'react'
22import styled from 'styled-components'
33import { navBarItemStyles } from './styles'
44
5+ type Action = {
6+ title : string
7+ onClick : ( ) => void
8+ }
9+
510export const ActionsMenu : React . FC = ( ) => {
611 const [ isActive , setIsActive ] = React . useState ( false )
712
13+ const actions : Action [ ] = [ ]
14+
15+ if ( ! actions . length ) return null
16+
817 return (
918 < Container title = 'More Actions' onClick = { ( ) => setIsActive ( ! isActive ) } >
1019 < svg viewBox = "0 0 24 24" >
@@ -13,7 +22,9 @@ export const ActionsMenu: React.FC = () => {
1322 < circle cx = "19" cy = "12" r = "2" />
1423 </ svg >
1524 < Popup isActive = { isActive } >
16- < Item > No actions available</ Item >
25+ { actions . map ( action => (
26+ < Item > < a onClick = { action . onClick } > { action . title } </ a > </ Item >
27+ ) ) }
1728 </ Popup >
1829 </ Container >
1930 )
You can’t perform that action at this time.
0 commit comments