From 63956f33d47648ed9df3e9551afc8fb76bbe4bc8 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 13 Dec 2025 21:44:34 +0200 Subject: [PATCH] Remove jquery from profile-search page --- frontend/src/ts/pages/profile-search.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/ts/pages/profile-search.ts b/frontend/src/ts/pages/profile-search.ts index 1bf6dbd90..81dc08a1d 100644 --- a/frontend/src/ts/pages/profile-search.ts +++ b/frontend/src/ts/pages/profile-search.ts @@ -5,17 +5,17 @@ import { ValidatedHtmlInputElement } from "../elements/input-validation"; import { UserNameSchema, UserProfile } from "@monkeytype/schemas/users"; import { remoteValidation } from "../utils/remote-validation"; import * as NavigationEvent from "../observables/navigation-event"; -import { qsr } from "../utils/dom"; +import { qs, qsr } from "../utils/dom"; let nameInputEl: ValidatedHtmlInputElement | null = null; let lastProfile: UserProfile | null = null; function enableButton(): void { - $('.page.pageProfileSearch button[type="submit"]').prop("disabled", false); + qs('.page.pageProfileSearch button[type="submit"]')?.enable(); } function disableButton(): void { - $('.page.pageProfileSearch button[type="submit"]').prop("disabled", true); + qs('.page.pageProfileSearch button[type="submit"]')?.disable(); } export const page = new Page({ @@ -57,11 +57,11 @@ export const page = new Page({ disableButton(); }, afterShow: async (): Promise => { - $(".page.pageProfileSearch input").trigger("focus"); + qs(".page.pageProfileSearch input")?.dispatch("focus"); }, }); -$(".page.pageProfileSearch form").on("submit", (e) => { +qs(".page.pageProfileSearch form")?.on("submit", (e) => { e.preventDefault(); if (lastProfile === null) return; NavigationEvent.dispatch(`/profile/${lastProfile.name}`, { @@ -69,6 +69,6 @@ $(".page.pageProfileSearch form").on("submit", (e) => { }); }); -$(() => { +document.addEventListener("DOMContentLoaded", () => { Skeleton.save("pageProfileSearch"); });