diff --git a/src/components/ui/FormFeedback.tsx b/src/components/ui/FormFeedback.tsx new file mode 100644 index 0000000..5662c41 --- /dev/null +++ b/src/components/ui/FormFeedback.tsx @@ -0,0 +1,27 @@ +import { Show, type JSX } from "solid-js"; + +export interface FormFeedbackProps { + type: "success" | "error"; + message: string | JSX.Element; + show?: boolean; + class?: string; +} + +export default function FormFeedback(props: FormFeedbackProps) { + const show = () => props.show ?? true; + + return ( + + + + ); +} + +export { FormFeedback }; diff --git a/src/routes/account.tsx b/src/routes/account.tsx index 90301a4..5eafbcd 100644 --- a/src/routes/account.tsx +++ b/src/routes/account.tsx @@ -15,6 +15,7 @@ import { api } from "~/lib/api"; import Input from "~/components/ui/Input"; import PasswordInput from "~/components/ui/PasswordInput"; import Button from "~/components/ui/Button"; +import FormFeedback from "~/components/ui/FormFeedback"; import type { UserProfile } from "~/types/user"; import PasswordStrengthMeter from "~/components/PasswordStrengthMeter"; @@ -611,11 +612,12 @@ export default function AccountPage() { : "Set Image"} - -
- Profile image updated! -
-
+ @@ -694,11 +696,12 @@ export default function AccountPage() { Submit - -
- Email updated! -
-
+ {/* Display Name Section */} @@ -741,11 +744,12 @@ export default function AccountPage() { Submit - -
- Display name updated! -
-
+ @@ -817,9 +821,11 @@ export default function AccountPage() { newPasswordConfRef.value.length >= 6 } > -
- Passwords do not match! -
+ - -
- Password did not match record -
-
+ diff --git a/src/routes/login/request-password-reset.tsx b/src/routes/login/request-password-reset.tsx index 26bdaa2..fde54e4 100644 --- a/src/routes/login/request-password-reset.tsx +++ b/src/routes/login/request-password-reset.tsx @@ -7,6 +7,7 @@ import { getClientCookie } from "~/lib/cookies.client"; import { COUNTDOWN_CONFIG } from "~/config"; import Input from "~/components/ui/Input"; import { Button } from "~/components/ui/Button"; +import FormFeedback from "~/components/ui/FormFeedback"; export default function RequestPasswordResetPage() { const navigate = useNavigate(); @@ -174,42 +175,18 @@ export default function RequestPasswordResetPage() { -
- If email exists, you will receive an email shortly! -
+ - -
-
- -
- ⏱️ Rate Limit Exceeded -
-
-
- {error()} -
-
-
-
+