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

View File

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