Skip to content

Commit 1d2ca08

Browse files
committed
improve the interactive-editor
1 parent 82ee714 commit 1d2ca08

File tree

5 files changed

+9
-56
lines changed

5 files changed

+9
-56
lines changed

src/app/conf/2025/components/testimonials/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ export function TestimonialAuthor({
115115
width={128}
116116
height={128}
117117
className="size-16 saturate-[.1] dark:opacity-90 xl:size-32"
118-
fetchPriority="low"
118+
// @ts-expect-error React doesn't know it exists yet, but @types/react do
119+
fetchpriority="low"
119120
/>
120121
<div className="absolute inset-0 z-[1] bg-pri-darker opacity-80 mix-blend-plus-lighter dark:mix-blend-color" />
121122
<Stripes />

src/components/index-page/how-it-works.tsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/components/index-page/how-it-works/interactive-editor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import React, { useState } from "react"
21
import { graphql } from "graphql"
2+
import React, { useState } from "react"
33

4+
import { getVariableToType } from "@/components/interactive-code-block/get-variable-to-type"
45
import { QueryEditor } from "@/components/interactive-code-block/query-editor"
56
import { ResultViewer } from "@/components/interactive-code-block/result-viewer"
6-
import { getVariableToType } from "@/components/interactive-code-block/get-variable-to-type"
77
import { VariableEditor } from "@/components/interactive-code-block/variable-editor"
88
import { CodeBlockLabel } from "@/components/pre/code-block-label"
99

1010
import { HowItWorksListItem } from "./how-it-works-list-item"
1111
import { PlayButton } from "./play-button"
1212
import {
13-
projectsSchema as schema,
1413
INITIAL_QUERY_TEXT,
1514
INITIAL_RESULTS_TEXT,
15+
projectsSchema as schema,
1616
} from "./schema"
1717

1818
export default function InteractiveEditor() {
@@ -91,7 +91,7 @@ export default function InteractiveEditor() {
9191
}
9292
code={
9393
Object.keys(variableTypes).length > 0 ? (
94-
<div className="hasVariables flex flex-col">
94+
<div className="flex flex-col">
9595
{editor}
9696
<div className="flex flex-col border-neu-200 dark:border-neu-50">
9797
<CodeBlockLabel

src/components/interactive-code-block/mini-graphiQL.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default class MiniGraphiQL extends Component<
9696
return (
9797
<div className="[&:not(:first-child)]:_mt-6 grid grid-cols-2 border border-neu-200 text-sm dark:border-neu-50">
9898
{Object.keys(this.state.variableToType).length > 0 ? (
99-
<div className="hasVariables flex flex-col">
99+
<div className="flex flex-col">
100100
{editor}
101101
<div className="flex flex-col border-neu-200 dark:border-neu-50">
102102
<CodeBlockLabel

src/components/interactive-code-block/syntax-highlighting.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
background: var(--cm-background);
6464
color: var(--cm-foreground);
6565
position: relative;
66+
max-height: 184px;
6667

6768
& .cm-content {
6869
padding: 16px 0;
@@ -75,6 +76,7 @@
7576
& .cm-scroller {
7677
line-height: 1.5;
7778
font-family: var(--font-mono);
79+
overflow: auto;
7880
-webkit-font-smoothing: auto;
7981
}
8082
}

0 commit comments

Comments
 (0)