Skip to content

Commit 0d9d59a

Browse files
authored
Merge pull request #3238 from garden-co/more-compact-hero
More compact hero
2 parents 2453d1d + 9347d11 commit 0d9d59a

File tree

11 files changed

+110
-83
lines changed

11 files changed

+110
-83
lines changed

homepage/homepage/app/(others)/(home)/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ export default function Home() {
1515
<>
1616
<HeroSection />
1717

18-
<ChatDemoSection />
1918

20-
<SupportedEnvironmentsSection />
19+
<ChatDemoSection />
2120

2221
<div className="container grid gap-8 pt-12">
2322
<ProblemStatementSection />

homepage/homepage/components/home/ChatDemoSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export function ChatDemoSection() {
169169
};
170170

171171
return (
172-
<div className="container grid items-start md:grid-cols-12">
172+
<div className="container grid items-start md:grid-cols-12 pt-6">
173173
<div className="md:col-span-7">
174174
<div className="grid items-start gap-4 sm:grid-cols-2 sm:gap-0">
175175
<Iframe

homepage/homepage/components/home/CodeStepAction.mdx

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

homepage/homepage/components/home/CodeStepCloud.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
```tsx
2-
// Use CoValues like reactive local state. Get instant UI updates on every edit — across all devices and users. 🎉
2+
import { useCoState }
3+
from "jazz-tools/react";
34

4-
import { useCoState } from "jazz-tools/react";
5+
function MessageList({ id }) {
6+
// Load & sync CoValues
7+
// Rerenders on local & remote edits!
8+
const chat = useCoState(Chat, id, {
9+
// Granular load of nested CoValues
10+
resolve: { $each: true }
11+
});
512

6-
const ChatScreen = ({ id }) => {
7-
const chat = useCoState(Chat, id);
8-
9-
return chat.messages.map(msg => (
10-
<p>{msg.text}</p>
11-
));
13+
return chat.$isLoaded ? <div>
14+
{chat.map(msg => ( // Looks like
15+
<p>{msg.text}</p> // plain JSON
16+
))}
17+
<TextInput onSubmit={(text) => {
18+
// Create and edit data anywhere!
19+
// Locally stored & synced
20+
chat.$jazz.push(Message.create(
21+
{ text }, chat.$jazz.owner
22+
));
23+
}} />
24+
</div> : <div>Loading...</div>;
1225
}
1326
```

homepage/homepage/components/home/CodeStepSchema.mdx

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```tsx
2+
import { co, z } from "jazz-tools";
3+
import { JazzReactProvider }
4+
from "jazz-tools/react";
5+
6+
// Describe your app with cloud-synced CoValues ("collaborative values")
7+
const Message = co.map({
8+
text: z.string(),
9+
});
10+
11+
const Chat = co.list(Message);
12+
13+
// Use our global auto-scaling
14+
// Jazz Cloud or self-host
15+
const peer =
16+
"wss://cloud.jazz.tools/?key=...";
17+
18+
function App() {
19+
return (
20+
<JazzReactProvider sync={{ peer }}>
21+
...
22+
</JazzReactProvider>
23+
);
24+
}
25+
```

homepage/homepage/components/home/CodeTabs.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
"use client";
22

33
import { clsx } from "clsx";
4-
import CodeStepAction from "./CodeStepAction.mdx";
5-
import CodeStepCloud from "./CodeStepCloud.mdx";
64
import CodeStepRender from "./CodeStepRender.mdx";
7-
import CodeStepSchema from "./CodeStepSchema.mdx";
5+
import CodeStepSetup from "./CodeStepSetup.mdx";
86

97
const codeFiles = [
108
{
11-
fileName: "schema.ts",
12-
component: CodeStepSchema,
9+
fileName: "setup.tsx",
10+
component: CodeStepSetup,
1311
},
1412
{
15-
fileName: "main.tsx",
16-
component: CodeStepCloud,
17-
},
18-
{
19-
fileName: "sendMessage.ts",
20-
component: CodeStepAction,
21-
},
22-
{
23-
fileName: "ChatScreen.tsx",
13+
fileName: "Components.tsx",
2414
component: CodeStepRender,
2515
},
2616
];

homepage/homepage/components/home/HeroSection.tsx

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,31 @@ import { CopyButton } from "@garden-co/design-system/src/components/molecules/Co
1313
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
1414
import clsx from "clsx";
1515
import { track } from "@vercel/analytics";
16+
import { SupportedEnvironmentsSection } from "./SupportedEnvironmentsSection";
1617

1718
export function HeroSection() {
1819
return (
19-
<section className="container grid items-start gap-8 py-12 md:grid-cols-12 md:gap-0 md:py-16">
20+
<section className="container grid items-start gap-8 py-12 md:grid-cols-12 md:gap-0 md:py-20">
2021
<div className="md:col-span-4">
21-
<Kicker className="mb-6">Ship Better Apps, Faster.</Kicker>
22-
<H1>
23-
<JazzSyncs className="max-w-96 md:max-w-full" aria-hidden="true" />
24-
<span className="sr-only">{marketingCopy.headline}</span>
22+
<Kicker className="mb-2">The database that syncs.</Kicker>
23+
<H1 className="text-3xl md:text-4xl lg:text-4xl">
24+
Things are easy when data syncs anywhere, instantly.
2525
</H1>
2626
<Prose
27-
size="md"
27+
size="lg"
2828
className="mt-6 prose-p:leading-normal dark:text-white"
2929
>
3030
<p>
31-
A new kind of distributed database that runs across your frontend,
32-
containers, serverless functions and its own cloud.
31+
Jazz is a distributed database that runs across your frontend,
32+
containers, functions, and our global auto-scaling storage cloud.
3333
</p>
3434
<p>
35-
It syncs data, files and LLM streams instantly and feels like
36-
reactive local JSON state.
37-
</p>
38-
<p>
39-
Built-in auth, orgs, multiplayer, edit history, permissions,
40-
encryption, offline support and more.
41-
</p>
42-
43-
<p className="text-base text-stone-600 dark:text-stone-400">
44-
Self-host or use Jazz Cloud for zero-config magic. Open source (MIT)
35+
Efficiently sync data, files and LLM streams. Use them like reactive
36+
local JSON state.
4537
</p>
4638
</Prose>
4739

48-
<div className="mt-8 grid gap-4">
40+
<div className="mb-2 mt-8 grid gap-4">
4941
<div className="relative col-span-2 w-full flex-1 overflow-hidden rounded-lg border-2 text-sm md:text-base lg:col-span-3">
5042
<NpxCreateJazzApp />
5143

@@ -58,11 +50,13 @@ export function HeroSection() {
5850
onCopy={() => track("create-jazz-app command copied from hero")}
5951
/>
6052
</div>
61-
<Button intent="primary" size="lg" href={`/docs/`}>
62-
<Icon name="docs" className="text-white" />
63-
Read the docs
64-
</Button>
6553
</div>
54+
55+
<p className="text-base text-stone-600 dark:text-stone-400">
56+
Open source (MIT) and self-hostable.
57+
</p>
58+
59+
<SupportedEnvironmentsSection />
6660
</div>
6761
<div className="md:col-span-7 md:col-start-6">
6862
<CodeTabs />

homepage/homepage/components/home/SupportedEnvironmentsSection.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { NodejsLogo } from "@/components/icons/NodejsLogo";
77
import { ReactLogo } from "@/components/icons/ReactLogo";
88
import { ReactNativeLogo } from "@/components/icons/ReactNativeLogo";
99
import { SvelteLogo } from "@/components/icons/SvelteLogo";
10+
import { TauriLogo } from "@/components/icons/TauriLogo";
1011
import Link from "next/link";
1112
import React from "react";
1213

@@ -21,6 +22,11 @@ const environments = [
2122
icon: ReactLogo,
2223
href: "/docs/react",
2324
},
25+
{
26+
name: "Svelte",
27+
icon: SvelteLogo,
28+
href: "/docs/svelte",
29+
},
2430
{
2531
name: "React Native",
2632
icon: ReactNativeLogo,
@@ -32,9 +38,8 @@ const environments = [
3238
href: "/docs/react-native-expo",
3339
},
3440
{
35-
name: "Svelte",
36-
icon: SvelteLogo,
37-
href: "/docs/svelte",
41+
name: "Tauri",
42+
icon: TauriLogo,
3843
},
3944
{
4045
name: "Node.js",
@@ -50,14 +55,14 @@ const environments = [
5055
icon: VercelLogo,
5156
},
5257
{
53-
name: "CF Workers",
58+
name: "CF DOs",
5459
icon: CloudflareWorkerLogo,
5560
},
5661
];
5762

5863
export function SupportedEnvironmentsSection() {
5964
return (
60-
<div className="container flex flex-wrap justify-center gap-4 py-12 md:gap-6 lg:pt-24">
65+
<div className="flex flex-wrap gap-4 py-12 md:gap-6">
6166
{environments.map(({ name, icon: Icon, href }) => {
6267
if (href) {
6368
return (

0 commit comments

Comments
 (0)