mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 00:43:54 +00:00
refactor(logo): improve flow for managing logo
This commit is contained in:
@@ -69,6 +69,9 @@ export default function ProjectData() {
|
||||
} catch (error) {
|
||||
const message = maybeAxiosError(error);
|
||||
setError('logo', { message });
|
||||
} finally {
|
||||
// Allow selecting the same local file again after an upload attempt.
|
||||
event.target.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -153,14 +156,21 @@ export default function ProjectData() {
|
||||
{watch('logo') ? (
|
||||
<>
|
||||
<img src={`${projectLogoPath}/${watch('logo')}`} />
|
||||
<Button
|
||||
variant='subtle-destructive'
|
||||
disabled={isSubmitting || !watch('logo')}
|
||||
onClick={handleDeleteLogo}
|
||||
>
|
||||
<IoTrash />
|
||||
Delete
|
||||
</Button>
|
||||
<div className={style.logoActions}>
|
||||
<Button disabled={isSubmitting} onClick={handleClickUpload} type='button'>
|
||||
<IoDownloadOutline />
|
||||
Replace logo
|
||||
</Button>
|
||||
<Button
|
||||
variant='subtle-destructive'
|
||||
disabled={isSubmitting || !watch('logo')}
|
||||
onClick={handleDeleteLogo}
|
||||
type='button'
|
||||
>
|
||||
<IoTrash />
|
||||
Delete
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<Button disabled={isSubmitting} onClick={handleClickUpload} type='button'>
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.logoActions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.customDataItem {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user