File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ const AppMenuItem = ({
36
36
open = { dialogOpen }
37
37
onClose = { handleCloseDialog }
38
38
message = "Hello from the Simple Menu app! (AppMenuItem)"
39
+ linkText = "App developer guide"
40
+ linkUrl = "https://github.com/cytoscape/cytoscape-web/wiki"
39
41
/>
40
42
</ >
41
43
)
Original file line number Diff line number Diff line change @@ -5,23 +5,40 @@ import DialogContent from '@mui/material/DialogContent'
5
5
import DialogContentText from '@mui/material/DialogContentText'
6
6
import DialogActions from '@mui/material/DialogActions'
7
7
import Button from '@mui/material/Button'
8
+ import { Box } from '@mui/material'
8
9
9
10
interface MessageDialogProps {
10
11
open : boolean
11
12
onClose : ( ) => void
12
13
message : string
14
+ linkText ?: string
15
+ linkUrl ?: string
13
16
}
14
17
15
18
const MessageDialog : React . FC < MessageDialogProps > = ( {
16
19
open,
17
20
onClose,
18
21
message,
22
+ linkText,
23
+ linkUrl,
19
24
} ) => {
20
25
return (
21
26
< Dialog open = { open } onClose = { onClose } >
22
27
< DialogTitle > Simple Menu App</ DialogTitle >
23
28
< DialogContent >
24
- < DialogContentText > { message } </ DialogContentText >
29
+ < DialogContentText >
30
+ < Box sx = { { p : '1em' } } > { message } </ Box >
31
+ < Box sx = { { p : '1em' } } >
32
+ { linkText && linkUrl && (
33
+ < >
34
+ { ' ' }
35
+ < a href = { linkUrl } target = "_blank" rel = "noopener noreferrer" >
36
+ { linkText }
37
+ </ a >
38
+ </ >
39
+ ) }
40
+ </ Box >
41
+ </ DialogContentText >
25
42
</ DialogContent >
26
43
< DialogActions >
27
44
< Button onClick = { onClose } color = "primary" >
You can’t perform that action at this time.
0 commit comments