1
- import { faSpinner } from '@fortawesome/free-solid-svg-icons' ;
1
+ import { faDownload , faSpinner } from '@fortawesome/free-solid-svg-icons' ;
2
2
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
3
3
import { ReactWidget } from '@jupyterlab/apputils' ;
4
4
import { Button , SidePanel , UseSignal } from '@jupyterlab/ui-components' ;
@@ -75,6 +75,12 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
75
75
handleCloseAddModelModal ( ) ;
76
76
} ;
77
77
78
+ const handleDownload = ( ) => {
79
+ const url =
80
+ 'https://raw.githubusercontent.com/QuantStack/jupyterlab-gather/main/resources/ar-cubes/cube1.pdf' ;
81
+ window . open ( url , '_blank' , 'noopener,noreferrer' ) ;
82
+ } ;
83
+
78
84
return (
79
85
< div className = "jlab-gather-sidebar-container" >
80
86
< div className = "jlab-gather-sidebar-description" >
@@ -97,21 +103,15 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
97
103
</ div >
98
104
< div style = { { display : 'flex' , flexDirection : 'column' } } >
99
105
< div className = "jlab-gather-sidebar-buttons" >
100
- < Button
101
- className = "jlab-gather-sidebar-button"
102
- onClick = { ( ) => handleModelSelectClick ( 0 ) }
103
- >
106
+ < Button onClick = { ( ) => handleModelSelectClick ( 0 ) } >
104
107
Set as first model
105
108
</ Button >
106
- < Button
107
- className = "jlab-gather-sidebar-button"
108
- onClick = { ( ) => handleModelSelectClick ( 1 ) }
109
- >
109
+ < Button onClick = { ( ) => handleModelSelectClick ( 1 ) } >
110
110
Set as second model
111
111
</ Button >
112
112
</ div >
113
113
< Button
114
- className = "jlab-gather-sidebar-load- button"
114
+ className = "jlab-gather-sidebar-button"
115
115
onClick = { handleOpenAddUrlModal }
116
116
disabled = { isDisabled }
117
117
>
@@ -123,7 +123,7 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
123
123
onClose = { handleCloseAddModelModal }
124
124
/>
125
125
< Button
126
- className = "jlab-gather-sidebar-load- button"
126
+ className = "jlab-gather-sidebar-button"
127
127
onClick = { handleOpenAddFileModal }
128
128
disabled = { isDisabled }
129
129
>
@@ -135,7 +135,7 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
135
135
onClose = { handleCloseAddModelModal }
136
136
/>
137
137
< Button
138
- className = "jlab-gather-sidebar-load- button"
138
+ className = "jlab-gather-sidebar-button"
139
139
onClick = { handleLoadSecondScene }
140
140
disabled = { isDisabled }
141
141
>
@@ -147,6 +147,16 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
147
147
'Load Second Model'
148
148
) }
149
149
</ Button >
150
+ < Button
151
+ className = "jlab-gather-sidebar-button jlab-gather-btn-with-icon"
152
+ onClick = { handleDownload }
153
+ >
154
+ < FontAwesomeIcon
155
+ icon = { faDownload }
156
+ className = "jlab-gather-icon-small"
157
+ />
158
+ Download AR Cube
159
+ </ Button >
150
160
</ div >
151
161
</ div >
152
162
) ;
0 commit comments