Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce basic homepage #6

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
import '@ens-tools/thorin-core/style.css';
export default function () {
return <div>ens.page v0.1-alpha.1</div>;
return (
<>
<section className="bg-ens-light-blue-light dark:bg-ens-dark-blue-surface h-48 flex justify-center items-center">
<div className="text-center">
<h1 className="text-2xl font-bold">Welcome to ENS Page</h1>
<p>Your personal link site, for your decentralized name.</p>
</div>
</section>
<section className="flex justify-center items-center">
<div className="mt-6">
<h2>View your ENS name</h2>
<form action={'/query'}>
<input
type="text"
name="name"
placeholder="ens.eth"
className="p-2 dark:bg-ens-dark-grey-surface bg-ens-light-grey-surface outline-ens-dark-blue-surface border border-black dark:border-neutral-500 rounded-lg rounded-r-none border-r-0"
></input>
<button
type="submit"
className="p-2 dark:bg-ens-dark-blue-light bg-ens-light-blue-light rounded-lg rounded-l-none"
>
Search
</button>
</form>
</div>
</section>
</>
);
}
11 changes: 11 additions & 0 deletions app/query/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

// This route is needed in order not to use the client side forms on the index
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);

if (!searchParams.has('name')) {
return Response.redirect('https://ens.page');
}

return Response.redirect('https://ens.page/' + searchParams.get('name'));
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@adraffy/ens-normalize": "^1.10.0",
"@ens-tools/format": "^0.0.2",
"@ens-tools/thorin-core": "0.0.3-8",
"autoprefixer": "^10.4.14",
"clsx": "^2.0.0",
"next": "^13.4.10",
Expand Down
Loading