-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add submissions page * Remove use client, metas --------- Co-authored-by: Carlos Sánchez <[email protected]>
- Loading branch information
1 parent
46333cf
commit a0fb798
Showing
4 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
packages/nextjs/app/submissions/_components/SubmissionCard.tsx
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,29 @@ | ||
import { Address } from "~~/components/scaffold-eth"; | ||
import { Submission } from "~~/services/database/repositories/submissions"; | ||
|
||
export const SubmissionCard = ({ submission }: { submission: Submission }) => { | ||
return ( | ||
<div key={submission.id} className="card bg-base-200 text-secondary-content border border-gray-300 rounded-none"> | ||
<div className="card-body p-4 pt-6"> | ||
<h2 className="card-title mb-3 xl:text-2xl">{submission.title}</h2> | ||
<div className="flex flex-wrap justify-between items-center gap-4"> | ||
<div className="mt-1 flex shrink-0 gap-3"> | ||
{submission.linkToRepository && ( | ||
<a href={submission.linkToRepository} className="inline-block" target="_blank"> | ||
<img alt="github icon" className="w-6 h-6" src="/icon-github.svg" /> | ||
</a> | ||
)} | ||
|
||
<a href={submission.linkToVideo} className="inline-block" target="_blank"> | ||
<img alt="youtube icon" className="w-6 h-6" src="/icon-youtube.svg" /> | ||
</a> | ||
</div> | ||
|
||
{submission.builder && <Address address={submission.builder} />} | ||
</div> | ||
|
||
<p>{submission.description}</p> | ||
</div> | ||
</div> | ||
); | ||
}; |
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,30 @@ | ||
import { SubmissionCard } from "./_components/SubmissionCard"; | ||
import type { NextPage } from "next"; | ||
import { getAllSubmissions } from "~~/services/database/repositories/submissions"; | ||
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; | ||
|
||
export const metadata = getMetadata({ | ||
title: "Submissions", | ||
description: "Check all the submissions for the SE-2 extensions hackathon.", | ||
}); | ||
|
||
const Submissions: NextPage = async () => { | ||
const submissions = await getAllSubmissions(); | ||
|
||
return ( | ||
<div className="max-w-7xl container mx-auto px-6"> | ||
<div className="grid gap-6 md:grid-cols-2 xl:grid-cols-3"> | ||
{submissions.length === 0 && ( | ||
<div role="alert" className="alert col-span-2"> | ||
<span>No submissions yet.</span> | ||
</div> | ||
)} | ||
{submissions.map(submission => { | ||
return <SubmissionCard key={submission.id} submission={submission} />; | ||
})} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Submissions; |
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