Skip to content

Commit 1d850da

Browse files
committed
fix cocalc's DemoCell (on the landing page)
1 parent c9d3002 commit 1d850da

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/packages/next/components/demo-cell.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { TAGS_MAP } from "@cocalc/util/db-schema/accounts";
1+
import { TAG_TO_FEATURE } from "@cocalc/util/db-schema/accounts";
22
import Markdown from "@cocalc/frontend/editors/slate/static-markdown";
33
import { FileContext } from "@cocalc/frontend/lib/file-context";
44

55
interface DemoCellProps {
6-
tag: keyof typeof TAGS_MAP;
6+
tag: keyof typeof TAG_TO_FEATURE;
77
style?: React.CSSProperties;
88
}
99

1010
export default function DemoCell({
1111
tag,
1212
style = { maxWidth: "800px", margin: "auto" },
1313
}: Readonly<DemoCellProps>) {
14-
const x = TAGS_MAP[tag];
14+
const x = TAG_TO_FEATURE[tag];
1515
if (x == null) return null;
1616
const { language, welcome } = x;
1717
const value = "```" + language + "\n" + (welcome ?? "2+3") + "\n```\n";

src/packages/util/db-schema/accounts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,11 @@ int main() {
668668
{ label: "Teaching", tag: "course", color: "green" },
669669
];
670670

671+
export const TAG_TO_FEATURE: { [key: string]: Readonly<Tag> } = {};
672+
for (const t of TAGS_FEATURES) {
673+
TAG_TO_FEATURE[t.tag] = t;
674+
}
675+
671676
const professional = "professional";
672677

673678
// Tags specific to user roles or if they want to be contacted

0 commit comments

Comments
 (0)