code review

This commit is contained in:
bniwredyc 2023-02-09 23:56:00 +01:00
parent 688e302392
commit ebfb6eeef1
2 changed files with 9 additions and 6 deletions

View File

@ -64,7 +64,7 @@ export const ProfileSettingsPage = () => {
return response.json()
}
const handleUserpicUpload = async () => {
const handleAvatarClick = async () => {
await selectFiles(async ([uploadFile]) => {
try {
setIsUserpicUpdating(true)
@ -99,9 +99,12 @@ export const ProfileSettingsPage = () => {
<div class="pretty-form__item">
<div class={styles.avatarContainer}>
<Show when={!isUserpicUpdating()} fallback={<Loading />}>
<button role="button" onClick={() => handleUserpicUpload()}>
<img class={styles.avatar} src={form.userpic} alt={form.name} />
</button>
<img
class={styles.avatar}
src={form.userpic}
alt={form.name}
onClick={handleAvatarClick}
/>
</Show>
</div>
</div>

View File

@ -21,13 +21,13 @@ h5 {
width: 18rem;
}
.avatar,
.avatarInput {
.avatar {
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
cursor: pointer;
}
.avatar {