refactor: Run prettier

This commit is contained in:
Roman Godmaire 2023-11-21 08:42:07 -05:00
parent 05050fb4d0
commit d029ff0ecd

View file

@ -15,105 +15,104 @@
<title>Account | Roll With It</title>
</svelte:head>
<main class="container">
<h1>Account</h1>
<section>
<form method="POST" action="?/updateAccount" use:enhance>
{#if form?.type === 'updateAccount'}
<small style="color: {form?.success ? 'green' : 'red'}">{form?.message}</small>
{/if}
<label for="username">
Username
<input
type="text"
name="username"
placeholder="Username"
value={form?.username ?? username}
aria-label="Email"
autocomplete="email"
required
/>
</label>
<h1>Account</h1>
<!-- Needed for spacing -->
<br />
<section>
<form method="POST" action="?/updateAccount" use:enhance>
{#if form?.type === 'updateAccount'}
<small style="color: {form?.success ? 'green' : 'red'}">{form?.message}</small>
{/if}
<label for="username">
Username
<input
type="text"
name="username"
placeholder="Username"
value={form?.username ?? username}
aria-label="Email"
autocomplete="email"
required
/>
</label>
<button type="submit">Save Changes</button>
</form>
</section>
<!-- Needed for spacing -->
<br />
<section>
<form method="POST" action="?/changePassword" use:enhance>
{#if form?.type === 'changePassword'}
<small style="color: {form?.success ? 'green' : 'red'}">{form.message}</small>
{/if}
<label for="current-password">
Current Password
<button type="submit">Save Changes</button>
</form>
</section>
<section>
<form method="POST" action="?/changePassword" use:enhance>
{#if form?.type === 'changePassword'}
<small style="color: {form?.success ? 'green' : 'red'}">{form.message}</small>
{/if}
<label for="current-password">
Current Password
<input
type="password"
name="current-password"
placeholder="Current password"
aria-label="Current Password"
autocomplete="current-password"
bind:value={currentPassword}
required
/>
</label>
<div class="grid">
<label for="new-password">
New Password
<input
type="password"
name="current-password"
placeholder="Current password"
aria-label="Current Password"
autocomplete="current-password"
bind:value={currentPassword}
name="new-password"
placeholder="Leave empty to keep your current password"
aria-label="New Password"
autocomplete="new-password"
bind:value={newPassword}
aria-invalid={newPassword.length === 0 ? null : newPassword.length < 8 ? true : false}
required
/>
</label>
<label for="confirm-password">
Confirm New Password
<input
type="password"
name="confirm-password"
placeholder="Confirm your new password"
aria-label="Confirm Password"
autocomplete="new-password"
bind:value={confirmPassword}
aria-invalid={confirmPassword.length === 0
? null
: newPassword !== confirmPassword
? true
: false}
required
/>
</label>
</div>
<div class="grid">
<label for="new-password">
New Password
<input
type="password"
name="new-password"
placeholder="Leave empty to keep your current password"
aria-label="New Password"
autocomplete="new-password"
bind:value={newPassword}
aria-invalid={newPassword.length === 0 ? null : newPassword.length < 8 ? true : false}
required
/>
</label>
<label for="confirm-password">
Confirm New Password
<input
type="password"
name="confirm-password"
placeholder="Confirm your new password"
aria-label="Confirm Password"
autocomplete="new-password"
bind:value={confirmPassword}
aria-invalid={confirmPassword.length === 0
? null
: newPassword !== confirmPassword
? true
: false}
required
/>
</label>
</div>
<button
type="submit"
disabled={currentPassword.length === 0 ||
newPassword.length < 8 ||
newPassword !== confirmPassword
? true
: false}
>
Change Password
</button>
</form>
</section>
<section>
<hgroup>
<h3>Billing Information</h3>
<h4>Thank you for your support!</h4>
</hgroup>
</section>
<form method="POST" action="?/signout">
<button class="secondary" type="submit">Logout</button>
<button
type="submit"
disabled={currentPassword.length === 0 ||
newPassword.length < 8 ||
newPassword !== confirmPassword
? true
: false}
>
Change Password
</button>
</form>
</main>
</section>
<section>
<hgroup>
<h3>Billing Information</h3>
<h4>Thank you for your support!</h4>
</hgroup>
</section>
<form method="POST" action="?/signout">
<button class="secondary" type="submit">Logout</button>
</form>