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

fix: added hotfix for submit page #679

Merged
merged 6 commits into from
Jun 3, 2024
Merged
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
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
Loading