Skip to content

Commit ac0d388

Browse files
committed
work on 3782 -- at least now everything imports from antd-bootstrap
HOWEVER: these components defined in antd-bootstrap are just imported from react-bootstrap: ControlLabel, Form, FormControl, FormGroup, InputGroup, ListGroup, ListGroupItem,
1 parent 065b79d commit ac0d388

File tree

3 files changed

+33
-19
lines changed

3 files changed

+33
-19
lines changed

src/packages/frontend/antd-bootstrap.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export {
2121
FormControl,
2222
FormGroup,
2323
InputGroup,
24+
ListGroup,
25+
ListGroupItem,
2426
} from "react-bootstrap";
27+
2528
import {
2629
Alert as AntdAlert,
2730
Button as AntdButton,

src/packages/frontend/custom-software/selector.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6-
import { Alert, Button, Divider } from "antd";
6+
import { Alert, Button, Divider, Radio } from "antd";
77
import { join } from "path";
88
import {
99
Col,
1010
ControlLabel,
1111
FormGroup,
1212
ListGroup,
1313
ListGroupItem,
14-
Radio,
1514
Row,
16-
} from "react-bootstrap";
17-
15+
} from "@cocalc/frontend/antd-bootstrap";
1816
import {
1917
CSS,
2018
React,
@@ -162,7 +160,7 @@ export const SoftwareEnvironment: React.FC<Props> = (props: Props) => {
162160
} else {
163161
// must be standard image
164162
const img = software_images.get(default_image);
165-
const display = img != null ? img.get("title") ?? "" : "";
163+
const display = img != null ? (img.get("title") ?? "") : "";
166164
set_state(default_image, display, "standard");
167165
}
168166
}, []);
@@ -449,7 +447,9 @@ export const SoftwareEnvironment: React.FC<Props> = (props: Props) => {
449447
}
450448

451449
function render_standard() {
452-
if (!haveSoftwareImages) return;
450+
if (!haveSoftwareImages) {
451+
return;
452+
}
453453
return (
454454
<Radio
455455
checked={image_type === "standard"}
@@ -464,15 +464,16 @@ export const SoftwareEnvironment: React.FC<Props> = (props: Props) => {
464464
}
465465

466466
function render_custom() {
467-
if (customize_kucalc !== KUCALC_COCALC_COM) return null;
467+
if (customize_kucalc !== KUCALC_COCALC_COM) {
468+
return null;
469+
}
468470

469471
if (images == null || images.size == 0) {
470472
return "There are no customized software environments available.";
471473
} else {
472474
return (
473475
<Radio
474476
checked={image_type === "custom"}
475-
label={"Custom software environment"}
476477
id={"custom-compute-image"}
477478
onChange={() => {
478479
set_state(undefined, undefined, "custom");
@@ -523,9 +524,9 @@ export const SoftwareEnvironment: React.FC<Props> = (props: Props) => {
523524

524525
{onCoCalcCom ? (
525526
<FormGroup>
526-
{render_default()}
527-
{render_standard()}
528-
{render_custom()}
527+
<div style={{ marginBottom: "5px" }}>{render_default()}</div>
528+
<div style={{ marginBottom: "5px" }}>{render_standard()}</div>
529+
<div style={{ marginBottom: "5px" }}>{render_custom()}</div>
529530
</FormGroup>
530531
) : (
531532
render_onprem()

src/packages/frontend/library/component.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@ import {
1818
ReactDOM,
1919
Fragment,
2020
} from "../app-framework";
21-
import { Col, Row, Button, ListGroup, ListGroupItem } from "react-bootstrap";
22-
import { Markdown, Icon, Loading, SearchInput } from "../components";
23-
import { webapp_client } from "../webapp-client";
24-
21+
import {
22+
Col,
23+
Row,
24+
Button,
25+
ListGroup,
26+
ListGroupItem,
27+
} from "@cocalc/frontend/antd-bootstrap";
28+
import {
29+
Markdown,
30+
Icon,
31+
Loading,
32+
SearchInput,
33+
} from "@cocalc/frontend/components";
34+
import { webapp_client } from "@cocalc/frontend/webapp-client";
2535

2636
declare var $: any;
2737

@@ -40,7 +50,7 @@ export const Library: React.FC<Props> = ({ project_id, onClose }) => {
4050
const library_selected = useTypedRedux({ project_id }, "library_selected");
4151
const library_is_copying = useTypedRedux(
4252
{ project_id },
43-
"library_is_copying"
53+
"library_is_copying",
4454
);
4555
const library_search = useTypedRedux({ project_id }, "library_search");
4656

@@ -60,7 +70,7 @@ export const Library: React.FC<Props> = ({ project_id, onClose }) => {
6070
// Using JSON of the doc is pretty naive but it's fast enough
6171
// and I don't want to spend much time on this!
6272
docs = docs.filter((doc) =>
63-
search_match(JSON.stringify(doc.toJS()).toLowerCase(), search)
73+
search_match(JSON.stringify(doc.toJS()).toLowerCase(), search),
6474
);
6575
}
6676

@@ -206,7 +216,7 @@ export const Library: React.FC<Props> = ({ project_id, onClose }) => {
206216
list.push(
207217
<li className="list-group-header" key={`header-${cur_cat}`}>
208218
{cur_cat_title}
209-
</li>
219+
</li>,
210220
);
211221
}
212222

@@ -220,7 +230,7 @@ export const Library: React.FC<Props> = ({ project_id, onClose }) => {
220230
bsSize={"small"}
221231
>
222232
{doc.get("title") ?? doc.get("id")}
223-
</ListGroupItem>
233+
</ListGroupItem>,
224234
);
225235
});
226236
return list;

0 commit comments

Comments
 (0)