Allow removing attachments
Show HTTP errors
This commit is contained in:
@ -39,12 +39,42 @@ export const Attachment = () => {
|
||||
}}
|
||||
></input>
|
||||
<span class="file-cta">
|
||||
<span class="file-label">{attachment_name || "Add Attachment"}</span>
|
||||
<span
|
||||
class="file-label"
|
||||
style={{
|
||||
maxWidth: "200px",
|
||||
}}
|
||||
>
|
||||
{attachment_name || "Add Attachment"}
|
||||
</span>
|
||||
<span class="file-icon">
|
||||
<i class="fas fa-upload"></i>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
{attachment_name && (
|
||||
<>
|
||||
<button
|
||||
onClick={() => {
|
||||
setReminder((reminder) => ({
|
||||
...reminder,
|
||||
attachment: null,
|
||||
attachment_name: null,
|
||||
}));
|
||||
}}
|
||||
style={{
|
||||
border: "none",
|
||||
background: "none",
|
||||
cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
<span class="sr-only">Remove attachment</span>
|
||||
<span class="icon">
|
||||
<i class="fas fa-trash"></i>
|
||||
</span>
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user