Skip to content

Commit 67c0949

Browse files
committed
Update pages list UI
1 parent 7c68b21 commit 67c0949

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

apps/web/pages/pages/index.tsx

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
2626
teams (
2727
id,
2828
name
29+
),
30+
page_settings (
31+
custom_domain
2932
)
3033
`
3134
)
@@ -103,12 +106,19 @@ export default function Pages({
103106
)}
104107

105108
{pages.length ? (
106-
<div className="overflow-hidden shadow sm:grid sm:grid-cols-2 sm:gap-px sm:divide-y-0 rounded-md bg-white dark:bg-black">
107-
{pages.map((page) => (
108-
<div
109-
key={page.id}
110-
className="relative group p-6 hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer"
111-
>
109+
<div className="overflow-hidden shadow rounded-md bg-white dark:bg-gray-900 border dark:border-gray-700">
110+
<div className="sm:grid sm:grid-cols-2">
111+
{pages.map((page, index) => (
112+
<div
113+
key={page.id}
114+
className={`relative group p-6 hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer transition-colors duration-200 ${
115+
index < pages.length - 1 ? 'border-b border-gray-200 dark:border-gray-700' : ''
116+
} ${
117+
index % 2 === 0 && index < pages.length - 2 ? 'sm:border-r sm:border-gray-200 sm:dark:border-gray-700' : ''
118+
} ${
119+
index % 2 === 0 && index === pages.length - 2 && pages.length % 2 === 0 ? 'sm:border-r sm:border-gray-200 sm:dark:border-gray-700' : ''
120+
}`}
121+
>
112122
<div>
113123
<span
114124
className={classNames(
@@ -135,18 +145,24 @@ export default function Pages({
135145
</span>
136146
</div>
137147
<div className="mt-6">
138-
<h3 className="text-lg font-medium dark:text-gray-50">
148+
<h3 className="text-lg font-medium dark:text-white">
139149
<a
140150
href={`${ROUTES.PAGES}/${page.id}`}
141-
className="focus:outline-none font-bold tracking-tight"
151+
className="focus:outline-none font-bold tracking-tight hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors duration-200"
142152
>
143153
<span className="absolute inset-0" aria-hidden="true" />
144154
{page.title}
145155
</a>
146156
</h3>
147-
<p className="mt-2 text-sm text-gray-500 dark:text-gray-200">
157+
<p className="mt-2 text-sm text-gray-500 dark:text-gray-400">
148158
{page.description}
149159
</p>
160+
<p className="mt-2 text-xs text-gray-400 dark:text-gray-500">
161+
{page.page_settings?.custom_domain
162+
? page.page_settings.custom_domain
163+
: `${page.url_slug}.changes.page`
164+
}
165+
</p>
150166
</div>
151167
<span
152168
className="pointer-events-none absolute top-6 right-6 text-gray-500 dark:text-gray-400 group-hover:text-indigo-400"
@@ -162,7 +178,8 @@ export default function Pages({
162178
) : null}
163179
</span>
164180
</div>
165-
))}
181+
))}
182+
</div>
166183
</div>
167184
) : null}
168185
</div>

0 commit comments

Comments
 (0)