6
6
import { Space } from "antd" ;
7
7
import { join } from "path" ;
8
8
import { defineMessage , useIntl } from "react-intl" ;
9
- import { Button , ButtonToolbar } from "@cocalc/frontend/antd-bootstrap" ;
9
+ import { Button } from "@cocalc/frontend/antd-bootstrap" ;
10
10
import { Icon , Tip , VisibleLG } from "@cocalc/frontend/components" ;
11
11
import LinkRetry from "@cocalc/frontend/components/link-retry" ;
12
12
import { useStudentProjectFunctionality } from "@cocalc/frontend/course" ;
@@ -17,6 +17,8 @@ import { KUCALC_COCALC_COM } from "@cocalc/util/db-schema/site-defaults";
17
17
import { useProjectContext } from "@cocalc/frontend/project/context" ;
18
18
import { useTypedRedux } from "@cocalc/frontend/app-framework" ;
19
19
import { type JSX , type MouseEvent } from "react" ;
20
+ import { SNAPSHOTS } from "@cocalc/util/consts/snapshots" ;
21
+ import Snapshots from "@cocalc/frontend/project/snapshots" ;
20
22
21
23
const SHOW_SERVER_LAUNCHERS = false ;
22
24
@@ -51,7 +53,7 @@ export function MiscSideButtons() {
51
53
52
54
const handle_backup = ( e : MouseEvent ) : void => {
53
55
e . preventDefault ( ) ;
54
- actions ?. open_directory ( ".snapshots" ) ;
56
+ actions ?. open_directory ( SNAPSHOTS ) ;
55
57
track ( "snapshots" , { action : "open" , where : "explorer" } ) ;
56
58
} ;
57
59
@@ -79,7 +81,7 @@ export function MiscSideButtons() {
79
81
}
80
82
return (
81
83
< Button bsSize = "small" onClick = { handle_backup } >
82
- < Icon name = "life-saver " /> { " " }
84
+ < Icon name = "disk-round " /> { " " }
83
85
< VisibleLG >
84
86
< span style = { { fontSize : 12 } } > Backups</ span >
85
87
</ VisibleLG >
@@ -168,10 +170,9 @@ export function MiscSideButtons() {
168
170
}
169
171
170
172
return (
171
- < ButtonToolbar
172
- style = { { whiteSpace : "nowrap" , padding : "0" } }
173
- className = "pull-right"
174
- >
173
+ < Space className = "pull-right" >
174
+ { ( current_path == SNAPSHOTS ||
175
+ current_path . startsWith ( SNAPSHOTS + "/" ) ) && < Snapshots /> }
175
176
{ SHOW_SERVER_LAUNCHERS && (
176
177
< Space . Compact >
177
178
{ render_jupyterlab_button ( ) }
@@ -190,6 +191,6 @@ export function MiscSideButtons() {
190
191
< TourButton project_id = { project_id } />
191
192
</ Space . Compact >
192
193
</ div >
193
- </ ButtonToolbar >
194
+ </ Space >
194
195
) ;
195
196
}
0 commit comments