forked from mirrors/pronouns.cc
fix(frontend): make fediverse login modals forms (fixes #97)
This commit is contained in:
parent
a1b2fce9af
commit
467069c898
2 changed files with 43 additions and 35 deletions
|
@ -34,7 +34,9 @@
|
|||
}
|
||||
});
|
||||
|
||||
const fediLogin = async () => {
|
||||
const fediLogin = async (e: Event) => {
|
||||
e.preventDefault();
|
||||
|
||||
fediDisabled = true;
|
||||
try {
|
||||
const resp = await apiFetch<{ url: string }>(
|
||||
|
@ -71,12 +73,13 @@
|
|||
{/if}
|
||||
</ListGroup>
|
||||
<Modal header="Pick an instance" isOpen={modalOpen} toggle={toggleModal}>
|
||||
<form on:submit={(e) => fediLogin(e)}>
|
||||
<ModalBody>
|
||||
<Input placeholder="Instance (e.g. mastodon.social)" bind:value={instance} />
|
||||
<p class="text-muted mt-2">
|
||||
<Icon name="info-circle-fill" aria-label="Info" /> This should be the domain you use to access
|
||||
posts. For example, if your username is <code>@timmie@mastodon.example</code>, but your
|
||||
user <em>page</em> is at
|
||||
<Icon name="info-circle-fill" aria-label="Info" /> This should be the domain you use to
|
||||
access posts. For example, if your username is <code>@timmie@mastodon.example</code>,
|
||||
but your user <em>page</em> is at
|
||||
<code>social.mastodon.example/timmie</code>, you should fill in
|
||||
<code>social.mastodon.example</code>.
|
||||
</p>
|
||||
|
@ -87,10 +90,11 @@
|
|||
{/if}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="primary" disabled={fediDisabled || instance === ""} on:click={fediLogin}
|
||||
<Button type="submit" color="primary" disabled={fediDisabled || instance === ""}
|
||||
>Log in</Button
|
||||
>
|
||||
</ModalFooter>
|
||||
</form>
|
||||
</Modal>
|
||||
<p class="text-muted mt-2 mx-1">
|
||||
<Icon name="info-circle-fill" aria-hidden /> By signing in, you consent to pronouns.cc storing
|
||||
|
|
|
@ -44,7 +44,9 @@
|
|||
let googleUnlinkModalOpen = false;
|
||||
let toggleGoogleUnlinkModal = () => (googleUnlinkModalOpen = !googleUnlinkModalOpen);
|
||||
|
||||
const fediLogin = async () => {
|
||||
const fediLogin = async (e: Event) => {
|
||||
e.preventDefault();
|
||||
|
||||
fediDisabled = true;
|
||||
try {
|
||||
const resp = await apiFetch<{ url: string }>(
|
||||
|
@ -205,6 +207,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
<Modal header="Pick an instance" isOpen={fediLinkModalOpen} toggle={toggleFediLinkModal}>
|
||||
<form on:submit={(e) => fediLogin(e)}>
|
||||
<ModalBody>
|
||||
<Input placeholder="Instance (e.g. mastodon.social)" bind:value={instance} />
|
||||
{#if error}
|
||||
|
@ -214,10 +217,11 @@
|
|||
{/if}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="primary" disabled={fediDisabled || instance === ""} on:click={fediLogin}
|
||||
<Button type="submit" color="primary" disabled={fediDisabled || instance === ""}
|
||||
>Log in</Button
|
||||
>
|
||||
</ModalFooter>
|
||||
</form>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
|
|
Loading…
Reference in a new issue