Skip to content

Commit 61a7849

Browse files
committed
fix latex build engine selector -- fallout of react19 upgrade (?)
1 parent 6346d96 commit 61a7849

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

src/packages/frontend/frame-editors/latex-editor/build-command.tsx

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
Customization and selection of the build command.
88
*/
99

10-
import { Alert, Dropdown, Form, Input } from "antd";
10+
import { Alert, Select, Form, Input } from "antd";
1111
import { List } from "immutable";
12-
13-
import { DownOutlined, SaveOutlined } from "@ant-design/icons";
12+
import { SaveOutlined } from "@ant-design/icons";
1413
import { Button } from "@cocalc/frontend/antd-bootstrap";
1514
import { React } from "@cocalc/frontend/app-framework";
16-
import {
17-
Icon,
18-
Loading,
19-
MenuItems,
20-
Paragraph,
21-
} from "@cocalc/frontend/components";
15+
import { Icon, Loading, Paragraph } from "@cocalc/frontend/components";
2216
import { split } from "@cocalc/util/misc";
2317
import { Actions } from "./actions";
2418
import {
@@ -74,7 +68,7 @@ export const BuildCommand: React.FC<Props> = React.memo((props: Props) => {
7468
const [build_command_prev, set_build_command_prev] =
7569
React.useState(build_command_orig);
7670
const [build_command, set_build_command] = React.useState<string>(
77-
build_command_string(build_command_orig)
71+
build_command_string(build_command_orig),
7872
);
7973
const [focus, set_focus] = React.useState<boolean>(false);
8074
const [dirty, set_dirty] = React.useState<boolean>(false);
@@ -91,7 +85,7 @@ export const BuildCommand: React.FC<Props> = React.memo((props: Props) => {
9185
engine,
9286
filename,
9387
knitr,
94-
actions.output_directory
88+
actions.output_directory,
9589
);
9690
actions.set_build_command(cmd);
9791
}
@@ -100,28 +94,28 @@ export const BuildCommand: React.FC<Props> = React.memo((props: Props) => {
10094
actions.init_build_directive(true);
10195
}
10296

103-
function engineOptions(): MenuItems {
97+
function engineOptions() {
10498
return ENGINES.map((engine) => {
10599
return {
106100
key: engine,
101+
value: engine,
107102
label: engine,
108-
onClick: () => select_engine(engine),
109103
};
110104
});
111105
}
112106

113107
function render_engines(): React.JSX.Element {
114108
return (
115-
<Dropdown
109+
<Select
110+
style={{ width: "200px" }}
116111
placement={"bottomRight"}
117-
menu={{ items: engineOptions() }}
118-
trigger={["hover", "click"]}
112+
options={engineOptions()}
119113
disabled={build_command_hardcoded}
114+
onChange={select_engine}
115+
placeholder="Engine..."
120116
>
121-
<Button bsSize={"xsmall"}>
122-
Engine <DownOutlined />
123-
</Button>
124-
</Dropdown>
117+
Engine
118+
</Select>
125119
);
126120
}
127121

@@ -191,7 +185,7 @@ export const BuildCommand: React.FC<Props> = React.memo((props: Props) => {
191185
return (
192186
<Button
193187
disabled={!dirty}
194-
bsSize={"xsmall"}
188+
bsSize={"small"}
195189
bsStyle={dirty ? "success" : undefined}
196190
title={"Saves the modified command (or just hit the 'Return' key)"}
197191
onClick={() => handle_build_change()}

0 commit comments

Comments
 (0)