1
- import { Component , For , createSignal , Setter } from "solid-js" ;
1
+ import { Component , For , createSignal , Setter , Show } from "solid-js" ;
2
2
import {
3
3
Flex ,
4
4
Box ,
5
5
createDisclosure ,
6
6
Heading ,
7
+ Button ,
7
8
} from "@hope-ui/solid" ;
8
9
9
10
import { instances } from "./store" ;
@@ -23,38 +24,67 @@ const Main: Component = () => {
23
24
onOpen ( ) ;
24
25
return setSearch ( value ) ;
25
26
} ;
26
-
27
27
const { isOpen, onOpen, onClose } = createDisclosure ( { defaultIsOpen : true } ) ;
28
28
29
29
return (
30
30
< >
31
31
{
32
- < SplitView >
33
- < Flex flexDirection = "column" >
34
- < Flex mb = "$1" justifyContent = "space-between" >
35
- < Heading level = "1" > Devices</ Heading >
36
- < InstancesButtons
37
- onAfterAdd = { ( instanceId ) => {
38
- scrollToInstance ( instanceId ) ;
39
- } }
40
- />
32
+ < Show when = { isOpen ( ) } fallback = {
33
+ < Flex >
34
+ < Flex flexDirection = "column" >
35
+ < Flex mb = "$1" justifyContent = "space-between" >
36
+ < Heading level = "1" > Devices</ Heading >
37
+ < InstancesButtons
38
+ onAfterAdd = { ( instanceId ) => {
39
+ scrollToInstance ( instanceId ) ;
40
+ } }
41
+ show_messages_button = { true }
42
+ onOpenMessages = { onOpen }
43
+ />
44
+ </ Flex >
45
+ < Box overflow = "auto" >
46
+ < Flex flexWrap = "wrap" gap = "$5" justifyContent = "center" >
47
+ < For each = { instances ( ) } >
48
+ { ( instance : InstanceData ) => (
49
+ < Instance instance = { instance } setSearch = { setSearchAndOpen } />
50
+ ) }
51
+ </ For >
52
+ </ Flex >
53
+ </ Box >
54
+ </ Flex >
41
55
</ Flex >
42
- < Box overflow = "auto" >
43
- < Flex flexWrap = "wrap" gap = "$5" justifyContent = "center" >
44
- < For each = { instances ( ) } >
45
- { ( instance : InstanceData ) => (
46
- < Instance instance = { instance } setSearch = { setSearchAndOpen } />
47
- ) }
48
- </ For >
56
+ } >
57
+ < SplitView >
58
+ < Flex flexDirection = "column" >
59
+ < Flex mb = "$1" justifyContent = "space-between" >
60
+ < Heading level = "1" > Devices</ Heading >
61
+ < InstancesButtons
62
+ onAfterAdd = { ( instanceId ) => {
63
+ scrollToInstance ( instanceId ) ;
64
+ } }
65
+ show_messages_button = { false }
66
+ onOpenMessages = { ( ) => { } }
67
+ />
49
68
</ Flex >
50
- </ Box >
51
- </ Flex >
52
- < Box overflow = "auto" >
53
- < Heading level = "1" mb = "1" > Messages</ Heading >
54
- < Sidebar search = { search } setSearch = { setSearchAndOpen } />
55
- </ Box >
56
- </ SplitView >
57
-
69
+ < Box overflow = "auto" >
70
+ < Flex flexWrap = "wrap" gap = "$5" justifyContent = "center" >
71
+ < For each = { instances ( ) } >
72
+ { ( instance : InstanceData ) => (
73
+ < Instance instance = { instance } setSearch = { setSearchAndOpen } />
74
+ ) }
75
+ </ For >
76
+ </ Flex >
77
+ </ Box >
78
+ </ Flex >
79
+ < Flex direction = "column" >
80
+ < Flex justifyContent = "space-between" marginBottom = "$1" >
81
+ < Heading display = "inline-block" level = "1" mb = "1" > Messages</ Heading >
82
+ < Button colorScheme = "neutral" size = "xs" onClick = { onClose } > Close Messages </ Button >
83
+ </ Flex >
84
+ < Sidebar search = { search } setSearch = { setSearchAndOpen } />
85
+ </ Flex >
86
+ </ SplitView >
87
+ </ Show >
58
88
}
59
89
</ >
60
90
) ;
0 commit comments