Skip to content

Commit bf922fd

Browse files
authored
Align table columns to mid and add divider (#19)
1 parent d6d4cc8 commit bf922fd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/nextjs/app/stats/page.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { useQuery } from "@tanstack/react-query";
44
import type { NextPage } from "next";
55

6-
const thStyles = "whitespace-nowrap px-3 py-3.5";
7-
const tdStyles = "whitespace-nowrap px-3 py-4";
6+
const thStyles = "whitespace-nowrap px-3 py-3.5 text-center";
7+
const tdStyles = "whitespace-nowrap px-3 py-4 text-center";
88

99
type ChallengeStat = {
1010
challenge: number;
@@ -71,21 +71,21 @@ const Stats: NextPage = () => {
7171
</dl>
7272
<div className="mt-8 overflow-hidden bg-base-100 border-2 border-t-4 border-l-4 border-green-700 border-t-green-600 border-l-green-500">
7373
<table className="w-full divide-y divide-green-600">
74-
<thead className="bg-green-600/30 font-dotGothic tracking-wide text-left text-gray-50 md:text-xl">
74+
<thead className="bg-green-600/30 font-dotGothic tracking-wide text-center text-gray-50 md:text-xl">
7575
<tr>
76-
<th scope="col" className={thStyles}>
76+
<th scope="col" className={`${thStyles} w-1/2`}>
7777
Flag
7878
</th>
79-
<th scope="col" className={thStyles}>
79+
<th scope="col" className={`${thStyles} w-1/2`}>
8080
Total Minted
8181
</th>
8282
</tr>
8383
</thead>
84-
<tbody className="divide-y divide-gray-700 bg-base-100 md:text-xl">
84+
<tbody className="divide-y divide-x divide-gray-700 bg-base-100 md:text-xl">
8585
{stats.challenges.stats
8686
.sort((a: ChallengeStat, b: ChallengeStat) => a.challenge - b.challenge)
8787
.map((stat: ChallengeStat) => (
88-
<tr key={stat.challenge}>
88+
<tr key={stat.challenge} className="divide-x divide-gray-700">
8989
<td className={tdStyles}>#{stat.challenge}</td>
9090
<td className={tdStyles}>{stat.count}</td>
9191
</tr>
@@ -111,21 +111,21 @@ const Stats: NextPage = () => {
111111
</dl>
112112
<div className="mt-8 overflow-hidden bg-base-100 border-2 border-t-4 border-l-4 border-green-700 border-t-green-600 border-l-green-500">
113113
<table className="w-full divide-y divide-green-600">
114-
<thead className="bg-green-600/30 font-dotGothic tracking-wide text-left text-gray-50 md:text-xl">
114+
<thead className="bg-green-600/30 font-dotGothic tracking-wide text-center text-gray-50 md:text-xl">
115115
<tr>
116-
<th scope="col" className={thStyles}>
116+
<th scope="col" className={`${thStyles} w-1/2`}>
117117
Flags captured
118118
</th>
119-
<th scope="col" className={thStyles}>
119+
<th scope="col" className={`${thStyles} w-1/2`}>
120120
Users
121121
</th>
122122
</tr>
123123
</thead>
124-
<tbody className="divide-y divide-gray-700 bg-base-100 md:text-xl">
124+
<tbody className="divide-y divide-x divide-gray-700 bg-base-100 md:text-xl">
125125
{stats.users.stats
126126
.sort((a: UserStat, b: UserStat) => a.challengesCount - b.challengesCount)
127127
.map((stat: UserStat) => (
128-
<tr key={stat.challengesCount}>
128+
<tr key={stat.challengesCount} className="divide-x divide-gray-700">
129129
<td className={tdStyles}>{stat.challengesCount}</td>
130130
<td className={tdStyles}>{stat.count}</td>
131131
</tr>

0 commit comments

Comments
 (0)