@@ -10,6 +10,8 @@ export let loader = async () => {
10
10
return { stats } ;
11
11
} ;
12
12
13
+ // TODO: target="_blank" for discord?
14
+
13
15
export const meta : Route . MetaFunction = ( { matches } ) => {
14
16
let { isProductionHost } = matches [ 0 ] . data ;
15
17
let robots = isProductionHost ? "index,follow" : "noindex, nofollow" ;
@@ -20,6 +22,29 @@ export const meta: Route.MetaFunction = ({ matches }) => {
20
22
] ;
21
23
} ;
22
24
25
+ type QuickLink = {
26
+ icon : string ;
27
+ title : string ;
28
+ to : string ;
29
+ } ;
30
+ const quicklinks : QuickLink [ ] = [
31
+ {
32
+ icon : "atom" ,
33
+ title : "Docs" ,
34
+ to : "home" ,
35
+ } ,
36
+ {
37
+ icon : "github-outline" ,
38
+ title : "GitHub" ,
39
+ to : "https://github.com/remix-run/react-router" ,
40
+ } ,
41
+ {
42
+ icon : "discord-outline" ,
43
+ title : "Discord" ,
44
+ to : "https://rmx.as/discord" ,
45
+ } ,
46
+ ] ;
47
+
23
48
type Highlight = {
24
49
icon : string ;
25
50
title : string ;
@@ -57,20 +82,20 @@ const adventures: Adventure[] = [
57
82
title : "I'm new!" ,
58
83
description : "Learn how to get the most out of React Router" ,
59
84
linkText : "Start Here" ,
60
- linkTo : "./ home" ,
85
+ linkTo : "home" ,
61
86
} ,
62
87
{
63
88
title : "I'm on v6" ,
64
89
description : "Upgrade to v7 in just a few steps" ,
65
90
linkText : "Upgrade Now" ,
66
- linkTo : "./ upgrading/v6" ,
91
+ linkTo : "upgrading/v6" ,
67
92
} ,
68
93
{
69
94
title : "I want to adopt framework features" ,
70
95
description :
71
96
"Learn how to adopt the new framework features in your existing React Router app" ,
72
97
linkText : "Adopt Framework Features" ,
73
- linkTo : "./ upgrading/component-routes" ,
98
+ linkTo : "upgrading/component-routes" ,
74
99
} ,
75
100
{
76
101
title : "I'm stuck" ,
@@ -82,27 +107,53 @@ const adventures: Adventure[] = [
82
107
83
108
export default function Home ( { loaderData } : Route . ComponentProps ) {
84
109
return (
85
- < main className = "flex min-h-full w-full flex-col items-center justify-center" >
86
- < section className = "from-23% via-82% flex w-full flex-col items-center gap-y-12 bg-gradient-to-b from-[#CCD2DE] via-[#D9DDE6] to-[#FAFBFD] to-100% pt -[96px] md:pt -[160px]" >
110
+ < main className = "flex min-h-full w-full flex-col items-center justify-center dark:bg-gray-900 " >
111
+ < section className = "from-23% via-82% flex w-full flex-col items-center gap-y-12 bg-gradient-to-b from-[#CCD2DE] via-[#D9DDE6] to-white to-100% py -[96px] dark:from-[#595F6C] dark:via-[#202228] dark:via-65% dark:to-gray-900 md:py -[160px]" >
87
112
< h1 >
88
- < img
89
- src = "/splash/hero-3d-logo.webp"
90
- alt = "React Router logo, nine dots in an upward triangle (one on top, two in the middle, three on the bottom) with a path of three highlighted and connected from top to bottom, next to the text React Router"
91
- className = "aspect-[32/5] w-[360px] md:w-[480px] lg:w-[640px] 2xl:w-[960px]"
92
- />
113
+ < picture className = "aspect-[32/5] w-[360px] md:w-[480px] lg:w-[640px] 2xl:w-[960px]" >
114
+ < source
115
+ srcSet = "/splash/hero-3d-logo.webp"
116
+ media = "(prefers-color-scheme: light)"
117
+ />
118
+ < source
119
+ srcSet = "/splash/hero-3d-logo.dark.webp"
120
+ media = "(prefers-color-scheme: dark)"
121
+ />
122
+ < img
123
+ src = "/splash/hero-3d-logo.webp"
124
+ alt = "React Router logo, nine dots in an upward triangle (one on top, two in the middle, three on the bottom) with a path of three highlighted and connected from top to bottom, next to the text React Router"
125
+ className = "aspect-[32/5] w-[360px] md:w-[480px] lg:w-[640px] 2xl:w-[960px]"
126
+ />
127
+ </ picture >
93
128
</ h1 >
94
- < p className = "mx-12 max-w-[540px] text-center text-xl text-gray-700 md:mx-0" >
129
+ < p className = "mx-12 max-w-[540px] text-center text-xl text-gray-700 dark:text-gray-200 md:mx-0" >
95
130
A user‑obsessed, standards‑focused, multi‑strategy router you can
96
131
deploy anywhere.
97
132
</ p >
98
- < Link
99
- to = "/home"
100
- className = "flex items-center p-8 pb-[96px] font-bold underline"
101
- >
102
- Read the docs
103
- </ Link >
133
+ < div className = "flex flex-col md:h-[72px] md:w-[460px] md:flex-row" >
134
+ { quicklinks . map ( ( { icon, title, to } , i ) => (
135
+ < Link
136
+ key = { title }
137
+ to = { to }
138
+ className = {
139
+ "flex gap-x-2 border border-gray-200 px-9 py-6 text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-200 dark:hover:text-gray-700" +
140
+ ( i === 0
141
+ ? " rounded-t-lg border-b-0 md:rounded-l-lg md:rounded-tr-none md:border-b md:border-r-0"
142
+ : "" ) +
143
+ ( i === 2
144
+ ? " rounded-b-lg border-t-0 md:rounded-r-lg md:rounded-bl-none md:border-l-0 md:border-t"
145
+ : "" )
146
+ }
147
+ >
148
+ < svg className = "h-6 w-6" >
149
+ < use href = { `${ iconsHref } #${ icon } ` } />
150
+ </ svg >
151
+ { title }
152
+ </ Link >
153
+ ) ) }
154
+ </ div >
104
155
</ section >
105
- < section className = "flex w-full flex-col items-center gap-y-24 bg-gradient-to-b from-[#FAFBFD] to-white px-12 py -12 md:gap-y-16 lg:gap-y-12" >
156
+ < section className = "flex w-full flex-col items-center gap-y-24 px-12 pb -12 dark:bg-gray-900 md:gap-y-16 lg:gap-y-12" >
106
157
< div className = "grid gap-x-16 gap-y-6 md:grid-flow-col" >
107
158
< img
108
159
src = "/splash/v7-badge-1.svg"
@@ -113,13 +164,13 @@ export default function Home({ loaderData }: Route.ComponentProps) {
113
164
className = "h-[52px] w-[140px] md:h-[72px] md:w-[194px]"
114
165
/>
115
166
</ div >
116
- < h2 className = "text-center text-3xl font-semibold text-gray-800" >
167
+ < h2 className = "text-center text-3xl font-semibold text-gray-800 dark:text-gray-100 " >
117
168
What to expect from this version:
118
169
</ h2 >
119
170
< dl className = "grid max-w-[540px] gap-x-12 gap-y-6 lg:max-w-5xl lg:grid-flow-col" >
120
171
{ highlights . map ( ( { icon, title, description } ) => (
121
172
< div key = { title } className = "relative flex flex-col gap-2 pl-14" >
122
- < dt className = "text-xl font-semibold text-gray-800" >
173
+ < dt className = "text-xl font-semibold text-gray-800 dark:text-gray-100 " >
123
174
< svg className = "absolute left-0 top-0 h-8 w-8" >
124
175
< use href = { `${ iconsHref } #${ icon } ` } />
125
176
</ svg >
@@ -131,18 +182,20 @@ export default function Home({ loaderData }: Route.ComponentProps) {
131
182
</ dl >
132
183
</ section >
133
184
< section className = "flex flex-col gap-y-12 p-12" >
134
- < h2 className = "mx-[-10px] text-center text-3xl font-semibold text-gray-800 dark:text-white " >
185
+ < h2 className = "mx-[-10px] text-center text-3xl font-semibold text-gray-800 dark:text-gray-100 " >
135
186
Choose Your Adventure:
136
187
</ h2 >
137
188
< div className = "grid max-w-[1200px] gap-6 md:grid-cols-2 2xl:grid-cols-4" >
138
189
{ adventures . map ( ( { title, description, linkText, linkTo } ) => (
139
190
< Link
140
191
key = { title }
141
192
to = { linkTo }
142
- className = "flex flex-col justify-between gap-y-6 rounded-lg border border-[#D9D9D9] p-8 hover:bg-gray-50 dark:hover:bg-gray-700"
193
+ className = "flex flex-col justify-between gap-y-6 rounded-lg border border-[#D9D9D9] p-8 hover:bg-gray-50 dark:border-gray-700 dark: hover:bg-gray-700"
143
194
>
144
195
< div className = "flex flex-col gap-y-4" >
145
- < h3 className = "text-2xl font-semibold" > { title } </ h3 >
196
+ < h3 className = "text-2xl font-semibold dark:text-gray-100" >
197
+ { title }
198
+ </ h3 >
146
199
< p className = "text-[#757575] dark:text-gray-300" >
147
200
{ description }
148
201
</ p >
@@ -154,7 +207,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
154
207
) ) }
155
208
</ div >
156
209
</ section >
157
- < section className = "grid w-full place-content-center bg-gray-50 p-12" >
210
+ < section className = "grid w-full place-content-center p-12" >
158
211
< Suspense fallback = { null } >
159
212
< Await resolve = { loaderData . stats } errorElement = { null } >
160
213
{ ( stats ) => (
@@ -165,7 +218,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
165
218
< use href = { `${ iconsHref } #${ svgId } ` } />
166
219
</ svg >
167
220
< div className = "flex flex-col" >
168
- < dd className = "text-2xl font-semibold text-gray-700" >
221
+ < dd className = "text-2xl font-semibold text-gray-700 dark:text-gray-200 " >
169
222
{ count ?. toLocaleString ( "en-US" ) }
170
223
</ dd >
171
224
< dt className = "text-gray-400" > { label } </ dt >
@@ -177,7 +230,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
177
230
</ Await >
178
231
</ Suspense >
179
232
</ section >
180
- < section className = "grid h-[205px] w-full place-content-center place-items-center gap-y-6 bg-gray-900 p-12" >
233
+ < section className = "grid h-[205px] w-full place-content-center place-items-center gap-y-6 bg-gray-50 p-12 dark:bg-black " >
181
234
< img src = "/splash/shopify-badge.svg" className = "h-[68px] w-[190px]" />
182
235
< p className = "text-sm text-gray-400" > © 2024 Shopify, Inc.</ p >
183
236
</ section >
0 commit comments