Skip to content

Commit 53512b5

Browse files
committed
refactor no-internet-banner to fix some typescript issues with nextjs import
1 parent 9b0e913 commit 53512b5

File tree

3 files changed

+4
-53
lines changed

3 files changed

+4
-53
lines changed

src/packages/frontend/project/no-internet-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import {
1919
ALERT_STYLE,
2020
A_STYLE,
2121
BannerApplySiteLicense,
22-
BUY_A_LICENSE_URL,
2322
NO_INTERNET,
2423
} from "./trial-banner";
24+
import { BUY_A_LICENSE_URL } from "./call-to-support";
2525

2626
const MANAGE_LICENSE_URL = join(appBasePath, "/licenses/managed");
2727

src/packages/frontend/project/trial-banner.tsx

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
import { Alert, Modal, Space, Tag, Tooltip } from "antd";
77
import humanizeList from "humanize-list";
8-
import { join } from "path";
98
import { useInterval } from "react-interval-hook";
10-
119
import {
1210
CSS,
1311
React,
@@ -18,9 +16,7 @@ import {
1816
useState,
1917
useTypedRedux,
2018
} from "@cocalc/frontend/app-framework";
21-
import { A, Icon, Paragraph, Text } from "@cocalc/frontend/components";
22-
import { SiteName } from "@cocalc/frontend/customize";
23-
import { appBasePath } from "@cocalc/frontend/customize/app-base-path";
19+
import { A, Icon, Paragraph } from "@cocalc/frontend/components";
2420
import { TimeAmount } from "@cocalc/frontend/editors/stopwatch/time";
2521
import { open_new_tab } from "@cocalc/frontend/misc";
2622
import {
@@ -39,6 +35,7 @@ import { COLORS, DOC_URL } from "@cocalc/util/theme";
3935
import { useAllowedFreeProjectToRun } from "./client-side-throttle";
4036
import { useProjectContext } from "./context";
4137
import { applyLicense } from "./settings/site-license";
38+
import { CallToSupport, BUY_A_LICENSE_URL } from "./call-to-support";
4239

4340
export const DOC_TRIAL = "https://doc.cocalc.com/trial.html";
4441

@@ -95,7 +92,6 @@ const INET_QUOTA =
9592
const MEMBER_QUOTA =
9693
"https://doc.cocalc.com/billing.html#what-is-member-hosting";
9794
// const ADD_LICENSE = "https://doc.cocalc.com/project-settings.html#project-add-license";
98-
export const BUY_A_LICENSE_URL = join(appBasePath, "/store/site-license");
9995

10096
export const TrialBanner: React.FC<BannerProps> = React.memo(
10197
(props: BannerProps) => {
@@ -475,48 +471,3 @@ function CountdownProject({ fontSize }: CountdownProjectProps) {
475471
</>
476472
);
477473
}
478-
479-
export function CallToSupport({ onClose }: { onClose? }) {
480-
return (
481-
<Alert
482-
closable={onClose != null}
483-
onClose={onClose}
484-
banner
485-
type="info"
486-
showIcon={false}
487-
message={
488-
<>
489-
<Paragraph strong>
490-
This is a call to support <SiteName /> by{" "}
491-
<A href={BUY_A_LICENSE_URL}>purchasing a license</A>.
492-
</Paragraph>
493-
<Paragraph>
494-
Behind the scenes,{" "}
495-
<A href={"/about/team"}>people are working hard</A> to keep the
496-
service running and improve it constantly. Your files and
497-
computations <A href={"/info/status"}>run in our cluster</A>, which
498-
costs money as well.
499-
</Paragraph>
500-
<Paragraph>
501-
<SiteName /> receives no funding from large organizations or
502-
charitable foundations. The site depends entirely{" "}
503-
<Text strong>on your financial support</Text> to continue operating.
504-
Without your financial support this service will not survive
505-
long-term!
506-
</Paragraph>
507-
<Paragraph>
508-
<A
509-
href={
510-
"/support/new?hideExtra=true&type=purchase&subject=Support+CoCalc&title=Support+CoCalc"
511-
}
512-
>
513-
Contact us
514-
</A>{" "}
515-
if you can give support in other ways or have any questions or
516-
comments.
517-
</Paragraph>
518-
</>
519-
}
520-
/>
521-
);
522-
}

src/packages/frontend/site-licenses/select-license.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Icon } from "@cocalc/frontend/components/icon";
1414
import { describe_quota as describeQuota } from "@cocalc/util/licenses/describe-quota";
1515
import { days_ago as daysAgo, isValidUUID, len } from "@cocalc/util/misc";
1616
import { COLORS } from "@cocalc/util/theme";
17-
import { CallToSupport } from "@cocalc/frontend/project/trial-banner";
17+
import { CallToSupport } from "@cocalc/frontend/project/call-to-support";
1818

1919
const { Option } = Select;
2020

0 commit comments

Comments
 (0)