Skip to content

Commit 3e820ce

Browse files
committed
more react-bootstrap --> antd-bootstrap
1 parent fff8fc2 commit 3e820ce

File tree

9 files changed

+46
-47
lines changed

9 files changed

+46
-47
lines changed

src/packages/frontend/project/explorer/file-listing/file-listing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { TERM_MODE_CHAR } from "./utils";
2929

3030
import * as misc from "@cocalc/util/misc";
3131
import { FormattedMessage } from "react-intl";
32-
const { Col, Row } = require("react-bootstrap");
32+
import { Col, Row } from "@cocalc/frontend/antd-bootstrap";
3333

3434
interface Props {
3535
// TODO: everything but actions/redux should be immutable JS data, and use shouldComponentUpdate

src/packages/frontend/project/explorer/file-listing/file-row.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import { Button, Popover } from "antd";
77
import memoizeOne from "memoize-one";
8-
import { Col, Row } from "react-bootstrap";
9-
8+
import { Col, Row } from "@cocalc/frontend/antd-bootstrap";
109
import { CSS, React, useState } from "@cocalc/frontend/app-framework";
1110
import { Icon, IconName, TimeAgo, Tip } from "@cocalc/frontend/components";
1211
import { useStudentProjectFunctionality } from "@cocalc/frontend/course";
@@ -202,7 +201,7 @@ export const FileRow: React.FC<Props> = React.memo((props) => {
202201
props.actions.open_file({
203202
path,
204203
foreground,
205-
explicit:true,
204+
explicit: true,
206205
});
207206
if (foreground) {
208207
props.actions.set_file_search("");
@@ -356,7 +355,7 @@ export const FileRow: React.FC<Props> = React.memo((props) => {
356355
<Col sm={1} xs={3} onClick={handle_click}>
357356
{render_icon()}
358357
</Col>
359-
<Col sm={4} smPush={5} xs={6}>
358+
<Col sm={4} xs={6}>
360359
{render_timestamp()}
361360
{props.isdir ? (
362361
<>
@@ -369,7 +368,7 @@ export const FileRow: React.FC<Props> = React.memo((props) => {
369368
</span>
370369
)}
371370
</Col>
372-
<Col sm={5} smPull={4} xs={12} onClick={handle_click}>
371+
<Col sm={5} xs={12} onClick={handle_click}>
373372
{render_name()}
374373
</Col>
375374
</Row>

src/packages/frontend/project/explorer/file-listing/help-alert.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
*/
55

66
import React from "react";
7-
8-
const { Alert } = require("react-bootstrap");
7+
import { Alert } from "@cocalc/frontend/antd-bootstrap";
98

109
const help_alert_error_syle: React.CSSProperties = {
1110
marginTop: "10px",

src/packages/frontend/project/explorer/file-listing/listing-header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import React from "react";
77
import { TypedMap } from "@cocalc/frontend/app-framework";
88
import { Icon, Gap } from "@cocalc/frontend/components";
9-
const { Row, Col } = require("react-bootstrap");
9+
import { Col, Row } from "@cocalc/frontend/antd-bootstrap";
1010

1111
// TODO: Flatten active_file_sort for easy PureComponent use
1212
interface Props {
@@ -59,13 +59,13 @@ export const ListingHeader: React.FC<Props> = (props: Props) => {
5959
<Col sm={1} xs={3}>
6060
{render_sort_link("type", "Type")}
6161
</Col>
62-
<Col sm={4} smPush={5} xs={6}>
62+
<Col sm={4} xs={6}>
6363
{render_sort_link("time", "Date Modified")}
6464
<span className="pull-right">
6565
{render_sort_link("size", "Size/Download/View")}
6666
</span>
6767
</Col>
68-
<Col sm={5} smPull={4} xs={12}>
68+
<Col sm={5} xs={12}>
6969
{render_sort_link("name", "Name")}
7070
</Col>
7171
</Row>

src/packages/frontend/project/explorer/file-listing/terminal-mode-display.tsx

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

6-
import React from "react";
7-
const { Alert, Row, Col } = require("react-bootstrap");
8-
9-
const row_style: React.CSSProperties = {
10-
textAlign: "left",
11-
color: "#888",
12-
marginTop: "5px",
13-
wordWrap: "break-word",
14-
};
15-
16-
const alert_style: React.CSSProperties = {
17-
marginTop: "5px",
18-
fontWeight: "bold",
19-
};
6+
import { Alert } from "antd";
7+
import { A } from "@cocalc/frontend/components/A";
8+
import { useState } from "react";
209

2110
export function TerminalModeDisplay() {
11+
const [extra, setExtra] = useState<boolean>(false);
2212
return (
23-
<Row style={row_style}>
24-
<Col sm={2} />
25-
<Col sm={8}>
26-
<Alert style={alert_style} bsStyle="info">
27-
You are in{" "}
28-
<a
29-
target="_blank"
30-
href="https://github.com/sagemathinc/cocalc/wiki/File-Listing#terminal-mode"
31-
>
32-
terminal mode
33-
</a>
34-
.
35-
</Alert>
36-
</Col>
37-
<Col sm={2} />
38-
</Row>
13+
<Alert
14+
banner
15+
type="info"
16+
style={{ margin: "5px 0 15px 0" }}
17+
message={
18+
<>
19+
You are in <a onClick={() => setExtra(!extra)}>terminal mode</a>.
20+
</>
21+
}
22+
description={
23+
extra && (
24+
<>
25+
Terminal mode is triggered by a leading <code>/</code> in the file
26+
filter box. If you would like to display all folders instead, enter
27+
a space in front of the <code>/</code>. Terminal mode allows you to
28+
quickly use common commands like <code>mv</code> or <code>cp</code>{" "}
29+
in the displayed directory without having to click on the file
30+
listing UI. Start{" "}
31+
<A href="https://www.google.com/search?q=introduction+to+command+line">
32+
here
33+
</A>{" "}
34+
for learning how to use the command line.
35+
</>
36+
)
37+
}
38+
/>
3939
);
4040
}

src/packages/frontend/project/explorer/mini-terminal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ const MiniTerminal0: React.FC<Props> = (props: Readonly<Props>) => {
217217
top: 0,
218218
color: COLORS.GRAY_M,
219219
fontSize: "10pt",
220+
background: "white",
220221
}}
221222
>
222223
<Icon name="times" />

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import React from "react";
7-
87
import { redux } from "@cocalc/frontend/app-framework";
98
import { Icon, SearchInput } from "@cocalc/frontend/components";
109
import { ProjectActions } from "@cocalc/frontend/project_store";
@@ -200,6 +199,7 @@ export const SearchBar = React.memo((props: Props) => {
200199
color: "#666",
201200
fontSize: "14pt",
202201
position: "absolute",
202+
background: "white",
203203
}}
204204
>
205205
<Icon name="times" />
@@ -283,7 +283,7 @@ export const SearchBar = React.memo((props: Props) => {
283283
autoSelect
284284
placeholder={intl.formatMessage({
285285
id: "project.explorer.search-bar.placeholder",
286-
defaultMessage: "Search or create file",
286+
defaultMessage: "Filter files (/ for terminal)...",
287287
})}
288288
value={file_search}
289289
on_change={on_change}
@@ -295,7 +295,7 @@ export const SearchBar = React.memo((props: Props) => {
295295
/>
296296
{render_file_creation_error()}
297297
{render_help_info()}
298-
<div style={output_style_searchbox}>
298+
<div style={{ ...output_style_searchbox, width: "100%", left: 0 }}>
299299
{render_output(error, {
300300
color: "darkred",
301301
margin: 0,

src/packages/frontend/project/search/body.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ function ProjectSearchInput({
295295
size={small ? "medium" : "large"}
296296
autoFocus={true}
297297
value={user_input}
298-
placeholder={`Enter your search ${
298+
placeholder={`Search contents of files ${
299299
neural ? "(semantic similarity)" : "(supports regular expressions)"
300-
}`}
300+
}...`}
301301
on_change={(value) => actions?.setState({ user_input: value })}
302302
on_submit={() => actions?.search()}
303303
on_clear={() =>

src/packages/frontend/project/search/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const ProjectSearchHeader: React.FC = () => {
1414

1515
return (
1616
<div style={{ marginTop: "0px", fontSize: SIZE }}>
17-
<Icon name="search" /> Search{" "}
17+
<Icon name="search" /> Search Contents of Files{" "}
1818
<span className="hidden-xs">
1919
{" in "}
2020
<PathNavigator

0 commit comments

Comments
 (0)