Add 'delete scratch' button to user profile page#1943
Conversation
|
I'm wondering if the delete button should be a filled red pill that's like |
…k it to match the improvement slot banner sizing a bit better; removed extra whitespace
|
Yeh I mean so it looks like it belongs next to the 100% pill 😎 |
|
Nice! Could you remove the This ^^ just change the 1px to 0, and/or make it translateX instead |
|
What would actually be pretty cool, is to hide the "Delete" word on mobile, so its just the trash can icon on small screens. You can do something similar to this code : |
| } | ||
|
|
||
| .delete-button { | ||
| --warning-color: #ce3a3a; |
There was a problem hiding this comment.
it might be worth trying to use tailwind for styling .. we're slowly moving away from the explicit (s)css to using tailwind. might help with all the !importants
|
|
||
| try { | ||
| await api.delete_(scratchUrl(scratch), {}); | ||
| setShowElement(false); // Hide deleted element to avoid performing a page refresh, and allow deleting more scratches |
There was a problem hiding this comment.
maybe we should disable the delete (have some const [isDeleting, setIsDeleting] = useState(false) and then set isDeleting before the delete (and disable the button to avoid users double-clicking?






These changes add a 'delete scratch' button to the user's profile, only viewable and usable by themselves and admins.
The button starts white and prompts for confirmation before deletion, but can be bypassed by holding shift (which also turns the button red).