-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
148 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import Hero from '@/components/molecules/Hero'; | ||
import { APP_NAME } from '@/config/app'; | ||
import { api } from '@/utils/api'; | ||
import { ArrowTopRightOnSquareIcon, BookmarkIcon, StarIcon } from '@heroicons/react/24/outline'; | ||
import { type NextPage } from 'next'; | ||
import { NextSeo } from 'next-seo'; | ||
import Link from 'next/link'; | ||
const Leaderboard: NextPage = () => { | ||
const { isLoading, data } = api.ideas.leaderboard.useQuery(); | ||
|
||
return ( | ||
<> | ||
<NextSeo | ||
title={`Ideas leaderboard - Generate Random Development Project Ideas}`} | ||
description={`${APP_NAME} is a free tool that generates random development project ideas based on your preferences. Use it to kickstart your next hackathon project or find inspiration for your next side project.`} | ||
/> | ||
<Hero> | ||
<h1 className="max-w-2xl text-4xl font-bold tracking-tight text-gray-900">Leaderboard</h1> | ||
<p className="mb-8 mt-6 max-w-2xl text-lg leading-8 text-gray-600"> | ||
Top 100 ideas generated by users on the website | ||
</p> | ||
</Hero> | ||
<div className="container mx-auto mb-12 grid grid-cols-1 gap-8"> | ||
{isLoading && <p>Loading...</p>} | ||
{!isLoading && ( | ||
<table className="z-50 table-auto border border-transparent"> | ||
<thead> | ||
<tr className="border-b"> | ||
<th className="px-4 py-2 text-start">Rank</th> | ||
<th className="px-4 py-2 text-start">Idea</th> | ||
<th className="px-4 py-2 text-start"> | ||
<StarIcon className="h-4 w-4 text-gray-500" /> | ||
</th> | ||
<th className="px-4 py-2 text-start"> | ||
<BookmarkIcon className="h-4 w-4 text-gray-500" /> | ||
</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{data && | ||
data.ideas.map((idea, index) => { | ||
return ( | ||
<tr key={idea.id}> | ||
<td className="px-4 py-2">{index + 1}</td> | ||
<td className="px-4 py-2">{idea.title}</td> | ||
<td className="px-4 py-2">{idea.rating ?? ''}</td> | ||
<td className="px-4 py-2">{idea.saveCount}</td> | ||
|
||
<td className="px-4 py-2"> | ||
<Link href={`/idea/${idea.id}`} target="_blank"> | ||
<ArrowTopRightOnSquareIcon className="h-4 w-4 text-gray-500" /> | ||
</Link> | ||
</td> | ||
</tr> | ||
); | ||
})} | ||
</tbody> | ||
</table> | ||
)} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Leaderboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3fb39f7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ideas – ./
whatshouldibuildnext.com
ideas-stormix.vercel.app
www.whatshouldibuildnext.com
ideas-git-main-stormix.vercel.app