Skip to content

Commit db006b2

Browse files
committed
Merge remote-tracking branch 'origin/master' into aria-20251024
2 parents f66337d + 5712629 commit db006b2

File tree

1 file changed

+24
-52
lines changed

1 file changed

+24
-52
lines changed

src/packages/frontend/projects/create-project.tsx

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
Create a new project
88
*/
99

10-
import { Button, Card, Col, Form, Input, Modal, Row, Space } from "antd";
10+
import { Button, Card, Col, Form, Input, Modal, Row } from "antd";
1111
import { delay } from "awaiting";
1212
import { FormattedMessage, useIntl } from "react-intl";
1313

1414
import { useAutoFocusPreference } from "@cocalc/frontend/account";
15-
import { Well } from "@cocalc/frontend/antd-bootstrap";
1615
import {
1716
CSS,
1817
redux,
@@ -228,7 +227,7 @@ export function NewProjectCreator({
228227
<Button
229228
cocalc-test={"create-project"}
230229
size="large"
231-
disabled={noProjects || state !== "view"}
230+
disabled={state !== "view"}
232231
onClick={toggle_editing}
233232
style={{ width: "100%" }}
234233
>
@@ -415,24 +414,6 @@ export function NewProjectCreator({
415414
</Row>
416415
{render_add_license()}
417416
{render_license()}
418-
{noProjects && (
419-
<Row>
420-
<Col sm={24} style={{ marginTop: "10px" }}>
421-
<Space>
422-
<Button disabled={state === "saving"} onClick={cancel_editing}>
423-
{intl.formatMessage(labels.cancel)}
424-
</Button>
425-
<Button
426-
disabled={isDisabled()}
427-
onClick={() => create_project()}
428-
type="primary"
429-
>
430-
{renderOKButtonText()}
431-
</Button>
432-
</Space>
433-
</Col>
434-
</Row>
435-
)}
436417
{render_error()}
437418
</>
438419
);
@@ -453,37 +434,28 @@ export function NewProjectCreator({
453434

454435
function render_project_creation(): React.JSX.Element | undefined {
455436
if (state === "view") return;
456-
// if user has no projects yet, show the create dialog directly – otherwise its a modal
457-
if (noProjects) {
458-
return (
459-
<Well style={{ backgroundColor: "#FFF" }}>
460-
{render_input_section()}
461-
</Well>
462-
);
463-
} else {
464-
return (
465-
<Modal
466-
title={intl.formatMessage(labels.create_project)}
467-
open={state === "edit" || state === "saving"}
468-
okButtonProps={{ disabled: isDisabled() }}
469-
okText={renderOKButtonText()}
470-
cancelText={intl.formatMessage(labels.cancel)}
471-
onCancel={cancel_editing}
472-
onOk={create_project}
473-
confirmLoading={state === "saving"}
474-
width={{
475-
xs: "90%",
476-
sm: "90%",
477-
md: "80%",
478-
lg: "75%",
479-
xl: "70%",
480-
xxl: "60%",
481-
}}
482-
>
483-
{render_input_section()}
484-
</Modal>
485-
);
486-
}
437+
return (
438+
<Modal
439+
title={intl.formatMessage(labels.create_project)}
440+
open={state === "edit" || state === "saving"}
441+
okButtonProps={{ disabled: isDisabled() }}
442+
okText={renderOKButtonText()}
443+
cancelText={intl.formatMessage(labels.cancel)}
444+
onCancel={cancel_editing}
445+
onOk={create_project}
446+
confirmLoading={state === "saving"}
447+
width={{
448+
xs: "90%",
449+
sm: "90%",
450+
md: "80%",
451+
lg: "75%",
452+
xl: "70%",
453+
xxl: "60%",
454+
}}
455+
>
456+
{render_input_section()}
457+
</Modal>
458+
);
487459
}
488460

489461
return (

0 commit comments

Comments
 (0)