Skip to content

Commit 7896d9c

Browse files
committed
minor cleanup of new project creation (in prep for more)
1 parent c266910 commit 7896d9c

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

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

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ interface Props {
4848

4949
type EditState = "edit" | "view" | "saving";
5050

51-
export const NewProjectCreator: React.FC<Props> = (props: Props) => {
52-
const { start_in_edit_mode, default_value } = props;
53-
51+
export const NewProjectCreator: React.FC<Props> = ({
52+
start_in_edit_mode,
53+
default_value,
54+
}: Props) => {
5455
const managed_licenses = useTypedRedux("billing", "managed_licenses");
5556

5657
// view --> edit --> saving --> view
@@ -79,6 +80,8 @@ export const NewProjectCreator: React.FC<Props> = (props: Props) => {
7980
[customize_kucalc],
8081
);
8182

83+
//const requireLicense = customize_kucalc == KUCALC_COCALC_COM;
84+
8285
const [form] = Form.useForm();
8386

8487
useEffect(() => {
@@ -227,7 +230,7 @@ export const NewProjectCreator: React.FC<Props> = (props: Props) => {
227230
function create_disabled() {
228231
return (
229232
// no name of new project
230-
title_text === "" ||
233+
!title_text?.trim() ||
231234
// currently saving (?)
232235
state === "saving" ||
233236
// user wants a non-default image, but hasn't selected one yet
@@ -381,36 +384,48 @@ export const NewProjectCreator: React.FC<Props> = (props: Props) => {
381384
/>
382385
</Form.Item>
383386
</Form>
387+
<div style={{ color: COLORS.GRAY, float: "right" }}>
388+
You can change the title at any time.
389+
</div>
384390
</Col>
385391
<Col sm={12}>
386392
<div style={{ color: COLORS.GRAY, marginLeft: "30px" }}>
387-
A <A href="https://doc.cocalc.com/project.html">project</A> is an
388-
isolated private computational workspace that you can share with
389-
others. You can easily change the project's title at any time in
390-
project settings.
393+
A <A href="https://doc.cocalc.com/project.html">project</A> is a
394+
private computational workspace that you can use with
395+
collaborators that you explicitly invite. You can attach powerful{" "}
396+
<A href="https://doc.cocalc.com/compute_server.html">
397+
GPUs, CPUs
398+
</A>{" "}
399+
and{" "}
400+
<A href="https://doc.cocalc.com/cloud_file_system.html">
401+
storage
402+
</A>{" "}
403+
to a project.
391404
</div>
392405
</Col>
393406
</Row>
394-
{render_advanced_toggle()}
395-
{render_advanced()}
396407
{render_add_license_toggle()}
397408
{render_add_license()}
398409
{render_license()}
410+
{render_advanced_toggle()}
411+
{render_advanced()}
399412
<Row>
400413
<Col sm={24} style={{ marginTop: "10px" }}>
401-
<Button.Group>
402-
<Button disabled={state === "saving"} onClick={cancel_editing}>
403-
Cancel
404-
</Button>
405-
<Button
406-
disabled={create_disabled()}
407-
onClick={() => create_project()}
408-
type="primary"
409-
>
410-
Create Project
411-
{create_disabled() ? " (enter a title above!)" : ""}
412-
</Button>
413-
</Button.Group>
414+
<Button
415+
disabled={state === "saving"}
416+
onClick={cancel_editing}
417+
style={{ marginRight: "8px" }}
418+
>
419+
Cancel
420+
</Button>
421+
<Button
422+
disabled={create_disabled()}
423+
onClick={() => create_project()}
424+
type="primary"
425+
>
426+
Create Project
427+
{create_disabled() ? " (enter a title above!)" : ""}
428+
</Button>
414429
</Col>
415430
</Row>
416431
<Row>

0 commit comments

Comments
 (0)