@@ -3,107 +3,98 @@ import type { Metadata } from 'next';
3
3
import dynamic from 'next/dynamic' ;
4
4
import Link from 'next/link' ;
5
5
import { componentsStructure } from '../../../components/structure' ;
6
- import PageTransition from '../../components/page-transition' ;
6
+ import { PageTransition } from '../../components/page-transition' ;
7
7
import { Spotlight } from '../../components/spotlight' ;
8
8
import { slugify } from '../../utils/slugify' ;
9
9
10
- const title = 'Components - React Email' ;
11
- const description =
12
- 'Build beautiful emails with pre-built components that you can copy-and-paste into your app.' ;
13
-
14
10
export const metadata : Metadata = {
15
- title,
16
- description,
11
+ title : 'Components - React Email' ,
12
+ description :
13
+ 'Build beautiful emails with pre-built components that you can copy-and-paste into your app.' ,
17
14
openGraph : {
18
- title,
19
- description,
20
- images : [
21
- {
22
- url : 'https://react.email/static/covers/patterns.png' ,
23
- } ,
24
- ] ,
15
+ images : [ { url : 'https://react.email/static/covers/patterns.png' } ] ,
25
16
} ,
26
17
alternates : {
27
18
canonical : '/components' ,
28
19
} ,
29
20
} ;
30
21
31
- const ComponentsPage = async ( ) => (
32
- < >
33
- < div className = "pointer-events-none absolute inset-0 flex justify-center" >
34
- < div className = "hidden h-full w-full max-w-7xl grid-cols-2 gap-4 px-4 lg:grid" >
35
- < div className = "border-r-slate-3 border-l border-l-slate-4" />
36
- < div className = "border-r border-r-slate-4" />
37
- </ div >
38
- </ div >
39
- < PageTransition className = "pb-10" key = "about" tag = "main" >
40
- < div className = "flex w-full flex-col gap-2 px-6 pt-16 pb-10 md:px-8" >
41
- < h1 className = "font-bold text-2xl text-slate-12" > Components</ h1 >
42
- < p >
43
- Build beautiful emails with pre-built components that you can
44
- copy-and-paste into your app.
45
- </ p >
22
+ export default async function ComponentsPage ( ) {
23
+ return (
24
+ < >
25
+ < div className = "pointer-events-none absolute inset-0 flex justify-center" >
26
+ < div className = "hidden h-full w-full max-w-7xl grid-cols-2 gap-4 px-4 lg:grid" >
27
+ < div className = "border-r-slate-3 border-l border-l-slate-4" />
28
+ < div className = "border-r border-r-slate-4" />
29
+ </ div >
46
30
</ div >
47
- < div className = "relative grid grid-cols-1 gap-x-4 px-1 pb-10 md:grid-cols-2 md:px-0 lg:grid-cols-3" >
48
- < div className = "-translate-x-1/2 absolute top-0 left-1/2 h-px w-[100dvw] border-slate-4 border-t" />
49
- < div className = "-translate-x-1/2 absolute bottom-0 left-1/2 h-px w-[100dvw] border-slate-4 border-b" />
50
- { componentsStructure . map ( ( category , index ) => {
51
- const slug = slugify ( category . name ) ;
52
- const Illustration = dynamic (
53
- ( ) =>
54
- import (
55
- `@/illustrations/${ category . name
56
- . toLowerCase ( )
57
- . replace ( / / g, '-' ) } `
58
- ) ,
59
- ) ;
31
+ < PageTransition className = "pb-10" key = "about" tag = "main" >
32
+ < div className = "flex w-full flex-col gap-2 px-6 pt-16 pb-10 md:px-8" >
33
+ < h1 className = "font-bold text-2xl text-slate-12" > Components</ h1 >
34
+ < p >
35
+ Build beautiful emails with pre-built components that you can
36
+ copy-and-paste into your app.
37
+ </ p >
38
+ </ div >
39
+ < div className = "relative grid grid-cols-1 gap-x-4 px-1 pb-10 md:grid-cols-2 md:px-0 lg:grid-cols-3" >
40
+ < div className = "-translate-x-1/2 absolute top-0 left-1/2 h-px w-[100dvw] border-slate-4 border-t" />
41
+ < div className = "-translate-x-1/2 absolute bottom-0 left-1/2 h-px w-[100dvw] border-slate-4 border-b" />
42
+ { componentsStructure . map ( ( category , index ) => {
43
+ const slug = slugify ( category . name ) ;
44
+ const Illustration = dynamic (
45
+ ( ) =>
46
+ import (
47
+ `@/illustrations/${ category . name
48
+ . toLowerCase ( )
49
+ . replace ( / / g, '-' ) } `
50
+ ) ,
51
+ ) ;
60
52
61
- return (
62
- < Link
63
- className = { classNames (
64
- 'group relative isolate mt-7 cursor-pointer scroll-m-6 rounded-md focus:outline-none focus:ring focus:ring-slate-2 md:before:absolute md:before:inset-0 md:before:rounded-md md:before:border md:before:border-slate-4 md:before:border-dashed md:before:transition-colors md:before:duration-[720ms] md:before:ease-[cubic-bezier(.24,.9,.32,1.4)] md:focus:before:border-slate-6 md:hover:before:border-slate-6' ,
65
- {
66
- 'md:ml-6' : index % 3 === 0 ,
67
- 'md:mx-3' : index % 3 === 1 ,
68
- 'md:mr-6' : index % 3 === 2 ,
69
- } ,
70
- ) }
71
- href = { `/components/${ slug } ` }
72
- key = { category . name }
73
- tabIndex = { 0 }
74
- >
75
- < Spotlight
53
+ return (
54
+ < Link
76
55
className = { classNames (
77
- 'relative isolate flex cursor-pointer flex-col justify-end rounded-md bg-black p-4 group- focus:ring group- focus:ring-slate-2 md:transition-transform md:duration-[240ms ] md:ease-[cubic-bezier(.36,.66,.6,1)] ' ,
56
+ 'group relative isolate mt-7 cursor-pointer scroll-m-6 rounded-md focus:outline-none focus:ring focus:ring-slate-2 md:before:absolute md:before:inset-0 md:before:rounded-md md:before:border md:before:border-slate-4 md:before:border-dashed md:before: transition-colors md:before: duration-[720ms ] md:before: ease-[cubic-bezier(.24,.9,.32,1.4)] md:focus:before:border-slate-6 md:hover:before:border-slate-6 ' ,
78
57
{
79
- 'md:group-hover:-translate-x-2 md:group-hover:-translate-y-2 md:group-focus:-translate-x-2 md:group-focus:-translate-y-2' :
80
- index % 3 === 0 ,
81
- 'md:group-hover:-translate-y-2 md:group-focus:-translate-y-2' :
82
- index % 3 === 1 ,
83
- 'md:group-hover:-translate-y-2 md:group-focus:-translate-y-2 md:group-focus:translate-x-2 md:group-hover:translate-x-2' :
84
- index % 3 === 2 ,
58
+ 'md:ml-6' : index % 3 === 0 ,
59
+ 'md:mx-3' : index % 3 === 1 ,
60
+ 'md:mr-6' : index % 3 === 2 ,
85
61
} ,
86
62
) }
63
+ href = { `/components/${ slug } ` }
64
+ key = { category . name }
65
+ tabIndex = { 0 }
87
66
>
88
- < div className = "pointer-events-none absolute inset-0 rounded-md border border-slate-4 transition-colors duration-300 ease-[cubic-bezier(.36,.66,.6,1)] group-hover:border-slate-6 group-focus:border-slate-6" />
89
- < div className = "relative flex aspect-[2/1] items-center justify-center overflow-hidden rounded-sm text-slate-300" >
90
- < div className = "absolute inset-0 bg-[radial-gradient(#27272A_.0313rem,transparent_.0313rem),_radial-gradient(#27272A_.0313rem,transparent_.0313rem)] bg-transparent opacity-80 [background-position:0_0,.625rem_.625rem] [background-size:1.25rem_1.25rem]" />
91
- < Illustration />
92
- </ div >
93
- < h3 className = "relative z-[2] mt-4 font-semibold text-slate-12 capitalize leading-7 tracking-wide" >
94
- { category . name }
95
- </ h3 >
96
- < span className = "relative z-[2] text-slate-11 text-xs" >
97
- { category . components . length } component
98
- { category . components . length > 1 && 's' }
99
- </ span >
100
- </ Spotlight >
101
- </ Link >
102
- ) ;
103
- } ) }
104
- </ div >
105
- </ PageTransition >
106
- </ >
107
- ) ;
108
-
109
- export default ComponentsPage ;
67
+ < Spotlight
68
+ className = { classNames (
69
+ 'relative isolate flex cursor-pointer flex-col justify-end rounded-md bg-black p-4 group-focus:ring group-focus:ring-slate-2 md:transition-transform md:duration-[240ms] md:ease-[cubic-bezier(.36,.66,.6,1)]' ,
70
+ {
71
+ 'md:group-hover:-translate-x-2 md:group-hover:-translate-y-2 md:group-focus:-translate-x-2 md:group-focus:-translate-y-2' :
72
+ index % 3 === 0 ,
73
+ 'md:group-hover:-translate-y-2 md:group-focus:-translate-y-2' :
74
+ index % 3 === 1 ,
75
+ 'md:group-hover:-translate-y-2 md:group-focus:-translate-y-2 md:group-focus:translate-x-2 md:group-hover:translate-x-2' :
76
+ index % 3 === 2 ,
77
+ } ,
78
+ ) }
79
+ >
80
+ < div className = "pointer-events-none absolute inset-0 rounded-md border border-slate-4 transition-colors duration-300 ease-[cubic-bezier(.36,.66,.6,1)] group-hover:border-slate-6 group-focus:border-slate-6" />
81
+ < div className = "relative flex aspect-[2/1] items-center justify-center overflow-hidden rounded-sm text-slate-300" >
82
+ < div className = "absolute inset-0 bg-[radial-gradient(#27272A_.0313rem,transparent_.0313rem),_radial-gradient(#27272A_.0313rem,transparent_.0313rem)] bg-transparent opacity-80 [background-position:0_0,.625rem_.625rem] [background-size:1.25rem_1.25rem]" />
83
+ < Illustration />
84
+ </ div >
85
+ < h3 className = "relative z-[2] mt-4 font-semibold text-slate-12 capitalize leading-7 tracking-wide" >
86
+ { category . name }
87
+ </ h3 >
88
+ < span className = "relative z-[2] text-slate-11 text-xs" >
89
+ { category . components . length } component
90
+ { category . components . length > 1 && 's' }
91
+ </ span >
92
+ </ Spotlight >
93
+ </ Link >
94
+ ) ;
95
+ } ) }
96
+ </ div >
97
+ </ PageTransition >
98
+ </ >
99
+ ) ;
100
+ }
0 commit comments