-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathwithout-version.tsx
75 lines (70 loc) · 2.16 KB
/
without-version.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { useEffect, useRef } from "react"
import { V1, V2, V3, V4, V5 } from "../code-blocks"
import { clsx } from "clsx"
export function WithoutVersion() {
const ref = useRef<HTMLDivElement>(null)
useEffect(() => {
let i = -1
const inView = ref.current!
function move() {
i = (i + 1) % 7
inView.className = "step" + i
}
move()
const interval = setInterval(move, 2200)
return () => {
clearInterval(interval)
}
}, [])
return (
<div className="index-gradient">
<section
className="conf-block container flex justify-around gap-14 max-lg:flex-col lg:flex-row-reverse lg:*:w-1/2"
id="without-versions"
>
<div className="max-lg:text-center">
<h2>
Evolve your API <br className="max-lg:hidden" />
without versions
</h2>
{/* Illustration showing more legs added to a graph? Or a type evolving over time? */}
<p>
Add new fields and types to your GraphQL API without impacting
existing queries. Aging fields can be deprecated and hidden from
tools. By using a single evolving version, GraphQL APIs give apps
continuous access to new features and encourage cleaner, more
maintainable server code.
</p>
</div>
<div
className={clsx(
"type-evolution mx-auto",
"[&_div.nextra-code]:h-full",
"rounded-md border border-gray-300 dark:border-neutral-700 [&_pre]:h-full [&_pre]:rounded-none [&_pre]:ring-0",
// Set background as nextra code block bg color
"_bg-white dark:_bg-black",
)}
aria-hidden
>
<div id="typeEvolveView" ref={ref}>
<div className="v1">
<V1 />
</div>
<div className="v2">
<V2 />
</div>
<div className="v3">
<V3 />
</div>
<div className="v4">
<V4 />
</div>
<div className="v5">
<V5 />
</div>
</div>
</div>
</section>
</div>
)
}