Skip to content

Commit a4d9b24

Browse files
committed
frontend/explorer/search: get rid of react-bootstrap Alert
1 parent 652e524 commit a4d9b24

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

src/packages/frontend/antd-bootstrap.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ import {
3535
Tooltip,
3636
} from "antd";
3737
import { MouseEventHandler } from "react";
38+
3839
import { inDarkMode } from "@cocalc/frontend/account/dark-mode";
39-
import { r_join } from "@cocalc/frontend/components/r_join";
4040
import { Gap } from "@cocalc/frontend/components/gap";
41+
import { r_join } from "@cocalc/frontend/components/r_join";
4142
import { COLORS } from "@cocalc/util/theme";
4243

4344
// Note regarding buttons -- there are 6 semantics meanings in bootstrap, but

src/packages/frontend/project/ask-filename.tsx

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

6-
import { useEffect } from "react";
76
import {
87
Button,
98
ButtonToolbar,
@@ -12,19 +11,21 @@ import {
1211
Form,
1312
Row,
1413
} from "@cocalc/frontend/antd-bootstrap";
14+
import { useEffect } from "react";
15+
1516
import { useActions, useTypedRedux } from "@cocalc/frontend/app-framework";
1617
import {
1718
Icon,
1819
Loading,
1920
SearchInput,
2021
SelectorInput,
2122
} from "@cocalc/frontend/components";
23+
import ComputeServer from "@cocalc/frontend/compute/inline";
2224
import { file_options } from "@cocalc/frontend/editor-tmp";
2325
import { IS_TOUCH } from "@cocalc/frontend/feature";
2426
import { NewFilenameFamilies } from "@cocalc/frontend/project/utils";
2527
import { DEFAULT_NEW_FILENAMES, NEW_FILENAMES } from "@cocalc/util/db-schema";
2628
import { FileSpec } from "../file-associations";
27-
import ComputeServer from "@cocalc/frontend/compute/inline";
2829

2930
interface Props {
3031
project_id: string;

src/packages/frontend/project/explorer/search-bar.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
*/
55

66
import React from "react";
7-
import { TERM_MODE_CHAR } from "./file-listing";
8-
import { Icon, SearchInput } from "../../components";
7+
8+
import { redux } from "@cocalc/frontend/app-framework";
9+
import { Icon, SearchInput } from "@cocalc/frontend/components";
910
import { ProjectActions } from "@cocalc/frontend/project_store";
10-
import { ListingItem } from "./types";
11-
import { output_style_searchbox } from "./mini-terminal";
12-
import { webapp_client } from "../../webapp-client";
13-
import { Alert } from "react-bootstrap";
11+
import { webapp_client } from "@cocalc/frontend/webapp-client";
1412
import { path_to_file } from "@cocalc/util/misc";
15-
import { redux } from "@cocalc/frontend/app-framework";
13+
import { Alert } from "antd";
14+
import { TERM_MODE_CHAR } from "./file-listing";
15+
import { output_style_searchbox } from "./mini-terminal";
16+
import { ListingItem } from "./types";
1617

1718
interface Props {
1819
project_id: string; // Added by miniterm functionality
@@ -155,9 +156,11 @@ export const SearchBar = React.memo((props: Props) => {
155156
text = `Showing files matching ${file_search}`;
156157
}
157158
return (
158-
<Alert style={{ wordWrap: "break-word" }} bsStyle="info">
159-
{text}
160-
</Alert>
159+
<Alert
160+
style={{ wordWrap: "break-word", marginBottom: "10px" }}
161+
type="info"
162+
message={text}
163+
/>
161164
);
162165
}
163166
}
@@ -166,12 +169,12 @@ export const SearchBar = React.memo((props: Props) => {
166169
if (file_creation_error) {
167170
return (
168171
<Alert
169-
style={{ wordWrap: "break-word" }}
170-
bsStyle="danger"
171-
onDismiss={dismiss_alert}
172-
>
173-
{file_creation_error}
174-
</Alert>
172+
style={{ wordWrap: "break-word", marginBottom: "10px" }}
173+
type="error"
174+
closable
175+
onClose={dismiss_alert}
176+
message={file_creation_error}
177+
/>
175178
);
176179
}
177180
}

0 commit comments

Comments
 (0)