Skip to content

Commit 4e02212

Browse files
committed
Move button to side panel and adjust css
1 parent 81f60a8 commit 4e02212

File tree

4 files changed

+29
-59
lines changed

4 files changed

+29
-59
lines changed

src/components/buttons/DownloadCubeButton.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/components/modals/DeviceSettingModal.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React, { ChangeEvent, useEffect, useRef } from 'react';
33

44
import { useCubeStore } from '../../store';
55
import Modal from './Modal';
6-
import DownloadCubeButton from '../buttons/DownloadCubeButton';
76

87
interface IAddNewModelModalProps {
98
isOpen: boolean;
@@ -61,7 +60,6 @@ const DeviceSettingModal = ({ isOpen, onClose }: IAddNewModelModalProps) => {
6160
updateDeviceOnChange(e.target.value, DeviceType.audioOutput)
6261
}
6362
/>
64-
<DownloadCubeButton />
6563
</div>
6664
</Modal>
6765
);

src/widgets/LeftSidebar.tsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
1+
import { faDownload, faSpinner } from '@fortawesome/free-solid-svg-icons';
22
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
33
import { ReactWidget } from '@jupyterlab/apputils';
44
import { Button, SidePanel, UseSignal } from '@jupyterlab/ui-components';
@@ -75,6 +75,12 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
7575
handleCloseAddModelModal();
7676
};
7777

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+
7884
return (
7985
<div className="jlab-gather-sidebar-container">
8086
<div className="jlab-gather-sidebar-description">
@@ -97,21 +103,15 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
97103
</div>
98104
<div style={{ display: 'flex', flexDirection: 'column' }}>
99105
<div className="jlab-gather-sidebar-buttons">
100-
<Button
101-
className="jlab-gather-sidebar-button"
102-
onClick={() => handleModelSelectClick(0)}
103-
>
106+
<Button onClick={() => handleModelSelectClick(0)}>
104107
Set as first model
105108
</Button>
106-
<Button
107-
className="jlab-gather-sidebar-button"
108-
onClick={() => handleModelSelectClick(1)}
109-
>
109+
<Button onClick={() => handleModelSelectClick(1)}>
110110
Set as second model
111111
</Button>
112112
</div>
113113
<Button
114-
className="jlab-gather-sidebar-load-button"
114+
className="jlab-gather-sidebar-button"
115115
onClick={handleOpenAddUrlModal}
116116
disabled={isDisabled}
117117
>
@@ -123,7 +123,7 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
123123
onClose={handleCloseAddModelModal}
124124
/>
125125
<Button
126-
className="jlab-gather-sidebar-load-button"
126+
className="jlab-gather-sidebar-button"
127127
onClick={handleOpenAddFileModal}
128128
disabled={isDisabled}
129129
>
@@ -135,7 +135,7 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
135135
onClose={handleCloseAddModelModal}
136136
/>
137137
<Button
138-
className="jlab-gather-sidebar-load-button"
138+
className="jlab-gather-sidebar-button"
139139
onClick={handleLoadSecondScene}
140140
disabled={isDisabled}
141141
>
@@ -147,6 +147,16 @@ const LeftSidebarComponent = ({ modelList, modelRegistry }: IModelInfoList) => {
147147
'Load Second Model'
148148
)}
149149
</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>
150160
</div>
151161
</div>
152162
);

style/base.css

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
border: 2px solid transparent;
2323
border-radius: var(--gather-border-radius);
2424
font-family: inherit;
25-
color: var(--jp-ui-font-color0);
25+
color: var(--jp-ui-font-color1);
2626
}
2727

2828
.jlab-gather-input::placeholder {
@@ -56,6 +56,11 @@
5656
color: whitesmoke;
5757
}
5858

59+
.jlab-gather-btn-with-icon {
60+
display: flex;
61+
align-items: center;
62+
gap: 0.5rem;
63+
}
5964
.jlab-gather-btn-danger {
6065
background-color: var(--jp-warn-color1) !important;
6166
color: black !important;
@@ -268,14 +273,9 @@
268273
}
269274

270275
.jlab-gather-sidebar-button {
271-
color: var(--jp-inverse-layout-color4);
272-
}
273-
274-
.jlab-gather-sidebar-load-button {
275276
max-width: 313px;
276277
margin: 0.5rem;
277278
padding: 0.5rem;
278-
color: var(--jp-inverse-layout-color4);
279279
}
280280

281281
.jlab-gather-presenter-container {
@@ -374,10 +374,6 @@
374374
color: var(--jp-ui-inverse-font-color1);
375375
}
376376

377-
.jlab-gather-avatar-grid {
378-
/* height: 60%; */
379-
}
380-
381377
.jlab-gather-avatar-sidepane {
382378
width: 128px;
383379
height: 128px;
@@ -447,6 +443,7 @@
447443

448444
.jlab-gather-device-settings-row {
449445
display: flex;
446+
align-items: center;
450447
}
451448

452449
.jlab-gather-device-title {

0 commit comments

Comments
 (0)