Skip to content

Commit 8176976

Browse files
authored
Merge pull request #7612 from sagemathinc/next-support-help_email
next/support: help_email for contacting
2 parents 002dd25 + d70a3a9 commit 8176976

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

src/packages/next/components/landing/contact.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
55

6-
import { useCustomize } from "lib/customize";
76
import A from "components/misc/A";
7+
import { useCustomize } from "lib/customize";
88

99
export default function Contact({
1010
lower,
1111
showEmail = true,
12+
useHelpEmail = false,
1213
}: {
1314
lower?: boolean;
1415
showEmail?: boolean;
16+
useHelpEmail?: boolean;
1517
}) {
16-
const { contactEmail } = useCustomize();
17-
if (!contactEmail) return <span>{lower ? "c" : "C"}ontact your site administrator</span>
18+
const { contactEmail, helpEmail } = useCustomize();
19+
20+
const email = useHelpEmail ? helpEmail : contactEmail;
21+
22+
if (!email)
23+
return <span>{lower ? "c" : "C"}ontact your site administrator</span>;
1824
return (
19-
<A href={"mailto:" + contactEmail}>
20-
{lower ? "c" : "C"}ontact {showEmail && contactEmail }
25+
<A href={"mailto:" + email}>
26+
{lower ? "c" : "C"}ontact {showEmail ? email : ""}
2127
</A>
2228
);
2329
}

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,8 @@ function stringToType(s?: any): Type {
4848
}
4949

5050
export default function Create() {
51-
const {
52-
contactEmail,
53-
zendesk,
54-
account,
55-
openaiEnabled,
56-
onCoCalcCom,
57-
siteName,
58-
} = useCustomize();
51+
const { account, onCoCalcCom, helpEmail, openaiEnabled, siteName, zendesk } =
52+
useCustomize();
5953
const router = useRouter();
6054
// The URL the user was viewing when they requested support.
6155
// This could easily be blank, but if it is set it can be useful.
@@ -147,12 +141,12 @@ export default function Create() {
147141
check the status of your support tickets
148142
</A>
149143
.{" "}
150-
{contactEmail && (
144+
{helpEmail ? (
151145
<>
152146
You can also email us directly at{" "}
153-
<A href={`mailto:${contactEmail}`}>{contactEmail}</A>.
147+
<A href={`mailto:${helpEmail}`}>{helpEmail}</A>.
154148
</>
155-
)}
149+
) : undefined}
156150
</p>
157151
{openaiEnabled && onCoCalcCom && !CHATGPT_DISABLED ? (
158152
<ChatGPT siteName={siteName} />
@@ -290,12 +284,12 @@ export default function Create() {
290284
style={{ margin: "15px auto", maxWidth: "500px" }}
291285
/>
292286
<br />
293-
{contactEmail && (
287+
{helpEmail ? (
294288
<>
295289
If you continue to have problems, email us directly at{" "}
296-
<A href={`mailto:${contactEmail}`}>{contactEmail}</A>.
290+
<A href={`mailto:${helpEmail}`}>{helpEmail}</A>.
297291
</>
298-
)}
292+
) : undefined}
299293
</div>
300294
)}
301295
{success && (

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Alert } from "antd";
2+
23
import Contact from "components/landing/contact";
34
import { useCustomize } from "lib/customize";
45

@@ -8,12 +9,12 @@ export function NoZendesk() {
89
return (
910
<Alert
1011
type="error"
11-
message="Zendesk Support is not configured."
12+
message="Support system is not configured."
1213
style={{ margin: "30px auto", maxWidth: "400px", fontSize: "13pt" }}
1314
description={
1415
contactEmail && (
1516
<>
16-
You can still <Contact lower />.
17+
You can still <Contact lower useHelpEmail />.
1718
</>
1819
)
1920
}

0 commit comments

Comments
 (0)