forked from worm-emoji/robes.market
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic frontend working with tailwind
- Loading branch information
1 parent
7cb12e1
commit 09d14a5
Showing
11 changed files
with
752 additions
and
134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
import 'tailwindcss/tailwind.css' | ||
import Head from 'next/head' | ||
function Robes({ Component, pageProps }) { | ||
return ( | ||
<> | ||
<Component {...pageProps} /> | ||
<style jsx global> | ||
{` | ||
body { | ||
background: black; | ||
color: white; | ||
} | ||
`} | ||
</style> | ||
<Head> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;600;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
</Head> | ||
</> | ||
) | ||
} | ||
|
||
export default Robes |
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 |
---|---|---|
@@ -1,15 +1,57 @@ | ||
import Link from 'next/link' | ||
import Layout from '../components/Layout' | ||
|
||
const IndexPage = () => ( | ||
<Layout title="Home | Next.js + TypeScript Example"> | ||
<h1>Hello Next.js 👋</h1> | ||
<p> | ||
<Link href="/about"> | ||
<a>About</a> | ||
</Link> | ||
</p> | ||
</Layout> | ||
) | ||
import { RobeInfo } from './api/robes' | ||
import { format as ts } from 'timeago.js' | ||
|
||
export async function getStaticProps() { | ||
const res = await fetch('https://robes-market.vercel.app/api/robes') | ||
const data = await res.json() | ||
|
||
return { | ||
props: { | ||
robes: data.robes, | ||
lastUpdate: data.lastUpdate, | ||
}, | ||
revalidate: 300, | ||
} | ||
} | ||
|
||
interface Props { | ||
robes: RobeInfo[] | ||
lastUpdate: string | ||
} | ||
|
||
const Robe = ({ robe }: { robe: RobeInfo }) => { | ||
return ( | ||
<a href={robe.url} target="_blank"> | ||
<div className="flex flex-col justify-center items-center gap-2 p-4 m-4 border border-white transform hover:scale-105 transition-all"> | ||
<img src={robe.svg} /> | ||
<div className="text-center"> | ||
<p className="text-lg">#{robe.id}</p> | ||
<p>{robe.price} ETH</p> | ||
</div> | ||
</div> | ||
</a> | ||
) | ||
} | ||
|
||
const IndexPage = ({ robes, lastUpdate }: Props) => { | ||
return ( | ||
<div className="font-mono flex flex-col justify-center items-center gap-4 pt-10 w-screen"> | ||
<h1 className="text-3xl">Divine Robes</h1> | ||
<div className="text-center"> | ||
<p className="text-xl"> | ||
The current floor price for Divine Robes is {robes[0].price} ETH. | ||
</p> | ||
<p>Last updated {ts(lastUpdate)}</p> | ||
|
||
<div className="grid grid-cols-2 pt-5"> | ||
{robes.map((robe) => { | ||
return <Robe robe={robe} key={robe.id} /> | ||
})} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default IndexPage |
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,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
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,14 @@ | ||
module.exports = { | ||
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], | ||
darkMode: false, // or 'media' or 'class' | ||
theme: { | ||
fontFamily: { | ||
mono: 'Inconsolata, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', | ||
}, | ||
extend: {}, | ||
}, | ||
variants: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} |
Oops, something went wrong.