Skip to content

Commit

Permalink
fix: added hotfix for submit page (#679)
Browse files Browse the repository at this point in the history
- fix url label
- added url input id
- removed empty `<p>` tag
- fix welcome page unused vars
  • Loading branch information
harshmangalam authored Jun 3, 2024
1 parent 2633b80 commit 99a00c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
27 changes: 9 additions & 18 deletions routes/submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export const handler: Handlers<undefined, SignedInState> = {
const url = form.get("url");

if (
typeof url !== "string" || !URL.canParse(url) ||
typeof title !== "string" || title === ""
typeof url !== "string" ||
!URL.canParse(url) ||
typeof title !== "string" ||
title === ""
) {
return redirect("/submit?error");
}
Expand All @@ -48,9 +50,7 @@ export default defineRoute<State>((_req, ctx) => {
<Head title="Submit" href={ctx.url.href} />
<main class="flex-1 flex flex-col justify-center mx-auto w-full space-y-16 p-4 max-w-6xl">
<div class="text-center">
<h1 class="heading-styles">
Share your project
</h1>
<h1 class="heading-styles">Share your project</h1>
<p class="text-gray-500">
Let the community know about your Deno-related blog post, video or
module!
Expand All @@ -69,18 +69,12 @@ export default defineRoute<State>((_req, ctx) => {
<div>
<IconCheckCircle class="inline-block mr-2" />
<strong>Do</strong> include a description with your title.

<div class="text-sm text-gray-500">
E.g. “Deno Hunt: the best place to share your Deno project”
</div>
</div>
<p>
</p>
</div>
<form
class="flex-1 flex flex-col justify-center"
method="post"
>
<form class="flex-1 flex flex-col justify-center" method="post">
<div>
<label
htmlFor="submit_title"
Expand All @@ -101,12 +95,13 @@ export default defineRoute<State>((_req, ctx) => {

<div class="mt-4">
<label
htmlFor="submit_title"
htmlFor="submit_url"
class="block text-sm font-medium leading-6 text-gray-900"
>
URL
</label>
<input
id="submit_url"
class="input-styles w-full mt-2"
type="url"
name="url"
Expand All @@ -128,11 +123,7 @@ export default defineRoute<State>((_req, ctx) => {
Sign in to submit &#8250;
</a>
)
: (
<button class={SUBMIT_STYLES}>
Submit
</button>
)}
: <button class={SUBMIT_STYLES}>Submit</button>}
</div>
</form>
</div>
Expand Down
5 changes: 3 additions & 2 deletions routes/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ function SetupInstruction() {
and{" "}
<span class="bg-green-100 dark:bg-gray-800 p-1 rounded">
GITHUB_CLIENT_SECRET
</span>, this message will disappear.
</span>
, this message will disappear.
</p>
</div>
);
}

export default defineRoute((req, ctx) => {
export default defineRoute((_req, ctx) => {
return (
<>
<Head title="Welcome" href={ctx.url.href} />
Expand Down

0 comments on commit 99a00c2

Please sign in to comment.