Skip to content

Commit 6ffebd8

Browse files
committed
make the "contact us!" on landing pages guide to a video chat
1 parent 591fdc0 commit 6ffebd8

File tree

4 files changed

+62
-44
lines changed

4 files changed

+62
-44
lines changed

src/packages/frontend/support/url.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface Options {
88
url?: string;
99
subject?: string;
1010
body?: string;
11-
type?: "problem" | "question" | "task" | "purchase";
11+
type?: "problem" | "question" | "task" | "purchase" | "chat";
1212
hideExtra?: boolean;
1313
context?: string; // additional context
1414
required?: string; // if required is a string, then the user MUST change the body of the input

src/packages/next/components/landing/live-demo.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ import { useEffect, useState } from "react";
66
export function liveDemoUrl(context) {
77
return getSupportUrl({
88
subject: "Contact Us!",
9-
type: "question",
10-
body: `I would like to chat with a CoCalc Representative!\n\nWHEN IS A GOOD TIME (include timezone!): [REQUIRED]\n\nYOUR ORGANIZATION: [REQUIRED]\n\n(Only requests filled out in good faith will receive a response.)\n`,
11-
hideExtra: true,
9+
type: "chat",
1210
context,
1311
url: "",
14-
required: "[REQUIRED]",
1512
});
1613
}
1714

src/packages/next/components/support/create.tsx

Lines changed: 59 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@ function VSpace({ children }) {
3939
);
4040
}
4141

42-
export type Type = "problem" | "question" | "task" | "purchase";
42+
export type Type = "problem" | "question" | "task" | "purchase" | "chat";
4343

4444
function stringToType(s?: any): Type {
45-
if (s == "problem" || s == "question" || s == "task" || s == "purchase")
45+
if (
46+
s == "problem" ||
47+
s == "question" ||
48+
s == "task" ||
49+
s == "purchase" ||
50+
s == "chat"
51+
)
4652
return s;
4753
return "problem"; // default;
4854
}
@@ -224,41 +230,55 @@ export default function Create() {
224230
<Type type="purchase" /> I have a question regarding
225231
purchasing a product.
226232
</Radio>
233+
<Radio value={"chat"}>
234+
<Type type="chat" /> I would like to schedule a video chat.
235+
</Radio>
227236
</VSpace>
228237
</Radio.Group>
229238
<br />
230-
{showExtra && type !== "purchase" && (
239+
{showExtra && type !== "purchase" && type != "chat" && (
231240
<>
232241
<Files onChange={setFiles} />
233242
<br />
234243
</>
235244
)}
236-
<b>
237-
<Status
238-
done={body && body.length >= MIN_BODY_LENGTH && hasRequired}
239-
/>{" "}
240-
Description
241-
</b>
242-
<div
243-
style={{
244-
marginLeft: "30px",
245-
borderLeft: "1px solid lightgrey",
246-
paddingLeft: "15px",
247-
}}
248-
>
249-
{type == "problem" && <Problem onChange={setBody} />}
250-
{type == "question" && (
251-
<Question onChange={setBody} defaultValue={body} />
252-
)}
253-
{type == "purchase" && (
254-
<Purchase
255-
onChange={setBody}
256-
defaultValue={body}
257-
showExtra={showExtra}
258-
/>
259-
)}
260-
{type == "task" && <Task onChange={setBody} />}
261-
</div>
245+
{type == "chat" && (
246+
<h1 style={{ textAlign: "center" }}>
247+
<b>
248+
<A href="https://calendly.com/cocalc">Book a Video Chat...</A>
249+
</b>
250+
</h1>
251+
)}
252+
{type != "chat" && (
253+
<>
254+
<b>
255+
<Status
256+
done={body && body.length >= MIN_BODY_LENGTH && hasRequired}
257+
/>{" "}
258+
Description
259+
</b>
260+
<div
261+
style={{
262+
marginLeft: "30px",
263+
borderLeft: "1px solid lightgrey",
264+
paddingLeft: "15px",
265+
}}
266+
>
267+
{type == "problem" && <Problem onChange={setBody} />}
268+
{type == "question" && (
269+
<Question onChange={setBody} defaultValue={body} />
270+
)}
271+
{type == "purchase" && (
272+
<Purchase
273+
onChange={setBody}
274+
defaultValue={body}
275+
showExtra={showExtra}
276+
/>
277+
)}
278+
{type == "task" && <Task onChange={setBody} />}
279+
</div>
280+
</>
281+
)}
262282
</VSpace>
263283

264284
<div style={{ textAlign: "center", marginTop: "30px" }}>
@@ -281,16 +301,16 @@ export default function Create() {
281301
{submitting
282302
? "Submitting..."
283303
: success
284-
? "Thank you for creating a ticket"
285-
: submitError
286-
? "Close the error box to try again"
287-
: !isValidEmailAddress(email)
288-
? "Enter Valid Email Address above"
289-
: !subject
290-
? "Enter Subject above"
291-
: (body ?? "").length < MIN_BODY_LENGTH
292-
? `Describe your ${type} in detail above`
293-
: "Create Support Ticket"}
304+
? "Thank you for creating a ticket"
305+
: submitError
306+
? "Close the error box to try again"
307+
: !isValidEmailAddress(email)
308+
? "Enter Valid Email Address above"
309+
: !subject
310+
? "Enter Subject above"
311+
: (body ?? "").length < MIN_BODY_LENGTH
312+
? `Describe your ${type} in detail above`
313+
: "Create Support Ticket"}
294314
</Button>
295315
{submitting && <Loading style={{ fontSize: "32pt" }} />}
296316
{submitError && (

src/packages/next/components/support/tickets.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ const TYPE_COLOR: { [name in Type]: string } = {
182182
question: "blue",
183183
task: "orange",
184184
purchase: "green",
185+
chat: "purple",
185186
};
186187

187188
export function Type({ status, type }: { status?: string; type: Type }) {

0 commit comments

Comments
 (0)