@@ -12,7 +12,8 @@ module Entry = {
12
12
}
13
13
14
14
@react.component
15
- let make = (~header , ~description , ~blog , ~entries : array <Entry .t >, ~archiveText ) =>
15
+ let make = (~header , ~description , ~blog , ~archiveText , ~children : (Entry .t , Entry .t , Entry .t )) => {
16
+ let (e1 , e2 , e3 ) = children
16
17
<SectionContainer .LargeCentered
17
18
paddingY = "pt-16 pb-3 lg:pt-24 lg:pb-8" paddingX = "px-4 sm:px-6 lg:px-8" >
18
19
<div className = "text-center" >
@@ -38,16 +39,14 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
38
39
<a href = "#" className = "hover:underline" > {React .string (blog )} </a >
39
40
</p >
40
41
<a href = "#" className = "block mt-2" >
41
- <h3 className = "text-xl font-semibold text-gray-900" >
42
- {React .string (entries [0 ].title )}
43
- </h3 >
44
- <p className = "mt-3 text-base text-gray-500" > {React .string (entries [0 ].excerpt )} </p >
42
+ <h3 className = "text-xl font-semibold text-gray-900" > {React .string (e1 .title )} </h3 >
43
+ <p className = "mt-3 text-base text-gray-500" > {React .string (e1 .excerpt )} </p >
45
44
</a >
46
45
</div >
47
46
<div className = "mt-6 flex items-center" >
48
47
<div className = "flex-shrink-0" >
49
48
<a href = "#" >
50
- <span className = "sr-only" > {React .string (entries [ 0 ] .author )} </span >
49
+ <span className = "sr-only" > {React .string (e1 .author )} </span >
51
50
<img
52
51
className = "h-10 w-10 rounded-full"
53
52
src = "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixqx=aimuGJ4P9C&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
@@ -57,12 +56,12 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
57
56
</div >
58
57
<div className = "ml-3" >
59
58
<p className = "text-sm font-medium text-gray-900" >
60
- <a href = "#" className = "hover:underline" > {React .string (entries [ 0 ] .author )} </a >
59
+ <a href = "#" className = "hover:underline" > {React .string (e1 .author )} </a >
61
60
</p >
62
61
<div className = "flex space-x-1 text-sm text-gray-500" >
63
- <time dateTime = entries [ 0 ] .dateValue > {React .string (entries [ 0 ] .date )} </time >
62
+ <time dateTime = e1 .dateValue > {React .string (e1 .date )} </time >
64
63
<span ariaHidden = true > {React .string (` ·` )} </span >
65
- <span > {React .string (entries [ 0 ] .readingTime ++ ` min read` )} </span >
64
+ <span > {React .string (e1 .readingTime ++ ` min read` )} </span >
66
65
</div >
67
66
</div >
68
67
</div >
@@ -82,16 +81,14 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
82
81
<a href = "#" className = "hover:underline" > {React .string (blog )} </a >
83
82
</p >
84
83
<a href = "#" className = "block mt-2" >
85
- <h3 className = "text-xl font-semibold text-gray-900" >
86
- {React .string (entries [1 ].title )}
87
- </h3 >
88
- <p className = "mt-3 text-base text-gray-500" > {React .string (entries [1 ].excerpt )} </p >
84
+ <h3 className = "text-xl font-semibold text-gray-900" > {React .string (e2 .title )} </h3 >
85
+ <p className = "mt-3 text-base text-gray-500" > {React .string (e2 .excerpt )} </p >
89
86
</a >
90
87
</div >
91
88
<div className = "mt-6 flex items-center" >
92
89
<div className = "flex-shrink-0" >
93
90
<a href = "#" >
94
- <span className = "sr-only" > {React .string (entries [ 1 ] .author )} </span >
91
+ <span className = "sr-only" > {React .string (e2 .author )} </span >
95
92
<img
96
93
className = "h-10 w-10 rounded-full"
97
94
src = "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixqx=aimuGJ4P9C&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
@@ -101,12 +98,12 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
101
98
</div >
102
99
<div className = "ml-3" >
103
100
<p className = "text-sm font-medium text-gray-900" >
104
- <a href = "#" className = "hover:underline" > {React .string (entries [ 1 ] .author )} </a >
101
+ <a href = "#" className = "hover:underline" > {React .string (e2 .author )} </a >
105
102
</p >
106
103
<div className = "flex space-x-1 text-sm text-gray-500" >
107
- <time dateTime = entries [ 1 ] .dateValue > {React .string (entries [ 1 ] .date )} </time >
104
+ <time dateTime = e2 .dateValue > {React .string (e2 .date )} </time >
108
105
<span ariaHidden = true > {React .string (` ·` )} </span >
109
- <span > {React .string (entries [ 1 ] .readingTime ++ ` min read` )} </span >
106
+ <span > {React .string (e2 .readingTime ++ ` min read` )} </span >
110
107
</div >
111
108
</div >
112
109
</div >
@@ -126,16 +123,14 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
126
123
<a href = "#" className = "hover:underline" > {React .string (blog )} </a >
127
124
</p >
128
125
<a href = "#" className = "block mt-2" >
129
- <h3 className = "text-xl font-semibold text-gray-900" >
130
- {React .string (entries [2 ].title )}
131
- </h3 >
132
- <p className = "mt-3 text-base text-gray-500" > {React .string (entries [2 ].excerpt )} </p >
126
+ <h3 className = "text-xl font-semibold text-gray-900" > {React .string (e3 .title )} </h3 >
127
+ <p className = "mt-3 text-base text-gray-500" > {React .string (e3 .excerpt )} </p >
133
128
</a >
134
129
</div >
135
130
<div className = "mt-6 flex items-center" >
136
131
<div className = "flex-shrink-0" >
137
132
<a href = "#" >
138
- <span className = "sr-only" > {React .string (entries [ 2 ] .author )} </span >
133
+ <span className = "sr-only" > {React .string (e3 .author )} </span >
139
134
<img
140
135
className = "h-10 w-10 rounded-full"
141
136
src = "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixqx=aimuGJ4P9C&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
@@ -145,12 +140,12 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
145
140
</div >
146
141
<div className = "ml-3" >
147
142
<p className = "text-sm font-medium text-gray-900" >
148
- <a href = "#" className = "hover:underline" > {React .string (entries [ 2 ] .author )} </a >
143
+ <a href = "#" className = "hover:underline" > {React .string (e3 .author )} </a >
149
144
</p >
150
145
<div className = "flex space-x-1 text-sm text-gray-500" >
151
- <time dateTime = entries [ 2 ] .date > {React .string (entries [ 2 ] .date )} </time >
146
+ <time dateTime = e3 .date > {React .string (e3 .date )} </time >
152
147
<span ariaHidden = true > {React .string (` ·` )} </span >
153
- <span > {React .string (entries [ 2 ] .readingTime ++ ` min read` )} </span >
148
+ <span > {React .string (e3 .readingTime ++ ` min read` )} </span >
154
149
</div >
155
150
</div >
156
151
</div >
@@ -163,3 +158,4 @@ let make = (~header, ~description, ~blog, ~entries: array<Entry.t>, ~archiveText
163
158
</a >
164
159
</p >
165
160
</SectionContainer .LargeCentered >
161
+ }
0 commit comments