forked from mirrors/pronouns.cc
chore: format
This commit is contained in:
parent
ac603ac18e
commit
ebc10d9558
10 changed files with 52 additions and 16 deletions
|
@ -6,12 +6,12 @@
|
||||||
type User,
|
type User,
|
||||||
type CustomPreferences,
|
type CustomPreferences,
|
||||||
} from "$lib/api/entities";
|
} from "$lib/api/entities";
|
||||||
import { Icon, Tooltip } from "@sveltestrap/sveltestrap";
|
import { Icon, Tooltip } from "@sveltestrap/sveltestrap";
|
||||||
import FallbackImage from "./FallbackImage.svelte";
|
import FallbackImage from "./FallbackImage.svelte";
|
||||||
|
|
||||||
export let user: User;
|
export let user: User;
|
||||||
export let member: PartialMember & {
|
export let member: PartialMember & {
|
||||||
unlisted?: boolean
|
unlisted?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
let pronouns: string | undefined;
|
let pronouns: string | undefined;
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
<a class="text-reset fs-5 text-break" href="/@{user.name}/{member.name}">
|
<a class="text-reset fs-5 text-break" href="/@{user.name}/{member.name}">
|
||||||
{member.display_name ?? member.name}
|
{member.display_name ?? member.name}
|
||||||
{#if member.unlisted === true}
|
{#if member.unlisted === true}
|
||||||
<span bind:this={iconElement} tabindex={0}><Icon name="lock"/></span>
|
<span bind:this={iconElement} tabindex={0}><Icon name="lock" /></span>
|
||||||
<Tooltip target={iconElement} placement="top">This member is hidden</Tooltip>
|
<Tooltip target={iconElement} placement="top">This member is hidden</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -190,14 +190,15 @@
|
||||||
{/if}
|
{/if}
|
||||||
{#if data.utc_offset}
|
{#if data.utc_offset}
|
||||||
<Tooltip target="user-clock" placement="top">Current time</Tooltip>
|
<Tooltip target="user-clock" placement="top">Current time</Tooltip>
|
||||||
<Icon id="user-clock" name="clock" aria-label="This user's current time" /> {currentTime} <span class="text-body-secondary">(UTC{timezone})</span>
|
<Icon id="user-clock" name="clock" aria-label="This user's current time" />
|
||||||
|
{currentTime} <span class="text-body-secondary">(UTC{timezone})</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if profileEmpty && $userStore?.id === data.id}
|
{#if profileEmpty && $userStore?.id === data.id}
|
||||||
<hr />
|
<hr />
|
||||||
<p>
|
<p>
|
||||||
<em>
|
<em>
|
||||||
Your profile is empty! You can customize it by going to the <a href="/@{data.name}/edit"
|
Your profile is empty! You can customize it by going to the <a
|
||||||
>edit profile</a
|
href="/@{data.name}/edit">edit profile</a
|
||||||
> page.</em
|
> page.</em
|
||||||
> <span class="text-muted">(only you can see this)</span>
|
> <span class="text-muted">(only you can see this)</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -5,7 +5,15 @@
|
||||||
import type { LayoutData } from "./$types";
|
import type { LayoutData } from "./$types";
|
||||||
import { addToast, delToast } from "$lib/toast";
|
import { addToast, delToast } from "$lib/toast";
|
||||||
import { apiFetchClient, fastFetchClient } from "$lib/api/fetch";
|
import { apiFetchClient, fastFetchClient } from "$lib/api/fetch";
|
||||||
import { Button, ButtonGroup, Modal, ModalBody, ModalFooter, Nav, NavItem } from "@sveltestrap/sveltestrap";
|
import {
|
||||||
|
Button,
|
||||||
|
ButtonGroup,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalFooter,
|
||||||
|
Nav,
|
||||||
|
NavItem,
|
||||||
|
} from "@sveltestrap/sveltestrap";
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
|
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
|
||||||
import IconButton from "$lib/components/IconButton.svelte";
|
import IconButton from "$lib/components/IconButton.svelte";
|
||||||
|
|
|
@ -41,7 +41,7 @@ export const load = (async ({ params }) => {
|
||||||
pronouns: pronouns.autocomplete,
|
pronouns: pronouns.autocomplete,
|
||||||
flags,
|
flags,
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if ("code" in e) error(500, e as App.Error);
|
if ("code" in e) error(500, e as App.Error);
|
||||||
throw e;
|
throw e;
|
||||||
|
|
|
@ -45,9 +45,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button on:click={() => ($member.fields = [...$member.fields, { name: null, entries: [] }])}>
|
||||||
on:click={() => ($member.fields = [...$member.fields, { name: null, entries: [] }])}
|
|
||||||
>
|
|
||||||
<Icon name="plus" aria-hidden /> Add new field
|
<Icon name="plus" aria-hidden /> Add new field
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const load = async ({ params }) => {
|
||||||
pronouns: pronouns.autocomplete,
|
pronouns: pronouns.autocomplete,
|
||||||
flags,
|
flags,
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if ("code" in e) error(500, e as App.Error);
|
if ("code" in e) error(500, e as App.Error);
|
||||||
throw e;
|
throw e;
|
||||||
|
|
|
@ -4,7 +4,14 @@
|
||||||
|
|
||||||
import { PreferenceSize, type APIError, type MeUser } from "$lib/api/entities";
|
import { PreferenceSize, type APIError, type MeUser } from "$lib/api/entities";
|
||||||
import IconButton from "$lib/components/IconButton.svelte";
|
import IconButton from "$lib/components/IconButton.svelte";
|
||||||
import { Button, ButtonGroup, FormGroup, Icon, Input, InputGroup } from "@sveltestrap/sveltestrap";
|
import {
|
||||||
|
Button,
|
||||||
|
ButtonGroup,
|
||||||
|
FormGroup,
|
||||||
|
Icon,
|
||||||
|
Input,
|
||||||
|
InputGroup,
|
||||||
|
} from "@sveltestrap/sveltestrap";
|
||||||
import { PUBLIC_SHORT_BASE } from "$env/static/public";
|
import { PUBLIC_SHORT_BASE } from "$env/static/public";
|
||||||
import CustomPreference from "./CustomPreference.svelte";
|
import CustomPreference from "./CustomPreference.svelte";
|
||||||
import { DateTime, FixedOffsetZone } from "luxon";
|
import { DateTime, FixedOffsetZone } from "luxon";
|
||||||
|
|
|
@ -3,7 +3,14 @@
|
||||||
import { fastFetchClient } from "$lib/api/fetch";
|
import { fastFetchClient } from "$lib/api/fetch";
|
||||||
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
|
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
|
||||||
import { addToast } from "$lib/toast";
|
import { addToast } from "$lib/toast";
|
||||||
import { Button, ButtonGroup, FormGroup, Modal, ModalBody, ModalFooter } from "@sveltestrap/sveltestrap";
|
import {
|
||||||
|
Button,
|
||||||
|
ButtonGroup,
|
||||||
|
FormGroup,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalFooter,
|
||||||
|
} from "@sveltestrap/sveltestrap";
|
||||||
import type { PageData } from "./$types";
|
import type { PageData } from "./$types";
|
||||||
import ReportCard from "./ReportCard.svelte";
|
import ReportCard from "./ReportCard.svelte";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { MAX_FLAGS, type APIError, type PrideFlag } from "$lib/api/entities";
|
import { MAX_FLAGS, type APIError, type PrideFlag } from "$lib/api/entities";
|
||||||
import { Button, Icon, Input, Modal, ModalBody, ModalFooter, ModalHeader } from "@sveltestrap/sveltestrap";
|
import {
|
||||||
|
Button,
|
||||||
|
Icon,
|
||||||
|
Input,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalFooter,
|
||||||
|
ModalHeader,
|
||||||
|
} from "@sveltestrap/sveltestrap";
|
||||||
import type { PageData } from "./$types";
|
import type { PageData } from "./$types";
|
||||||
import Flag from "./Flag.svelte";
|
import Flag from "./Flag.svelte";
|
||||||
import prettyBytes from "pretty-bytes";
|
import prettyBytes from "pretty-bytes";
|
||||||
|
|
|
@ -2,7 +2,14 @@
|
||||||
import { flagURL, type APIError, type PrideFlag } from "$lib/api/entities";
|
import { flagURL, type APIError, type PrideFlag } from "$lib/api/entities";
|
||||||
import { apiFetchClient } from "$lib/api/fetch";
|
import { apiFetchClient } from "$lib/api/fetch";
|
||||||
import { addToast } from "$lib/toast";
|
import { addToast } from "$lib/toast";
|
||||||
import { Button, Input, Modal, ModalBody, ModalFooter, ModalHeader } from "@sveltestrap/sveltestrap";
|
import {
|
||||||
|
Button,
|
||||||
|
Input,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalFooter,
|
||||||
|
ModalHeader,
|
||||||
|
} from "@sveltestrap/sveltestrap";
|
||||||
|
|
||||||
export let flag: PrideFlag;
|
export let flag: PrideFlag;
|
||||||
export let deleteFlag: (id: string) => Promise<void>;
|
export let deleteFlag: (id: string) => Promise<void>;
|
||||||
|
|
Loading…
Reference in a new issue