feat(frontend): pad member page back button, add link to member page on edit page

This commit is contained in:
Sam 2023-03-14 22:31:45 +01:00
parent c4d7acc3f6
commit 149a7fba88
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
3 changed files with 13 additions and 3 deletions

View File

@ -5,12 +5,15 @@
export let color: "primary" | "secondary" | "success" | "danger"; export let color: "primary" | "secondary" | "success" | "danger";
export let tooltip: string; export let tooltip: string;
export let active: boolean = false; export let active: boolean = false;
export let click: (e: MouseEvent) => void; export let disabled: boolean = false;
export let click: ((e: MouseEvent) => void) | undefined = undefined;
export let href: string | undefined = undefined;
let button: HTMLElement; let button: HTMLElement;
</script> </script>
<Tooltip target={button} placement="top">{tooltip}</Tooltip> <Tooltip target={button} placement="top">{tooltip}</Tooltip>
<Button {color} {active} on:click={click} bind:inner={button}> <Button {color} {active} {disabled} {href} on:click={click} bind:inner={button}>
<Icon name={icon} /> <Icon name={icon} />
</Button> </Button>

View File

@ -30,7 +30,7 @@
<br /><a href="/edit/member/{data.id}">Edit profile</a> <br /><a href="/edit/member/{data.id}">Edit profile</a>
</Alert> </Alert>
{/if} {/if}
<div> <div class="m-3">
<Button color="secondary" href="/@{data.user.name}"> <Button color="secondary" href="/@{data.user.name}">
<Icon name="arrow-left" /> Back to {data.user.display_name ?? data.user.name} <Icon name="arrow-left" /> Back to {data.user.display_name ?? data.user.name}
</Button> </Button>

View File

@ -17,6 +17,7 @@
Button, Button,
ButtonGroup, ButtonGroup,
FormGroup, FormGroup,
Icon,
Input, Input,
Modal, Modal,
ModalBody, ModalBody,
@ -258,6 +259,12 @@
<h1> <h1>
Edit member profile Edit member profile
<ButtonGroup> <ButtonGroup>
<IconButton
color="secondary"
icon="chevron-left"
href="/@{data.member.user.name}/{data.member.name}"
tooltip="Back to member"
/>
{#if modified} {#if modified}
<Button color="success" on:click={() => updateMember()}>Save changes</Button> <Button color="success" on:click={() => updateMember()}>Save changes</Button>
{/if} {/if}