Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

feat(web): sleeker alert + remove collection name confirmation requirement

daniel31x137c740f01d2aa
diff --git a/apps/web/components/ModalContent/DeleteCollectionModal.tsx b/apps/web/components/ModalContent/DeleteCollectionModal.tsx
index 6b65df26..88fffd75 100644
--- a/apps/web/components/ModalContent/DeleteCollectionModal.tsx
+++ b/apps/web/components/ModalContent/DeleteCollectionModal.tsx
@@ -23,7 +23,6 @@ export default function DeleteCollectionModal({
useState<CollectionIncludingMembersAndLinkCount>(activeCollection);
const [submitLoader, setSubmitLoader] = useState(false);
const router = useRouter();
- const [inputField, setInputField] = useState("");
const permissions = usePermissions(collection.id as number);
useEffect(() => {
@@ -33,7 +32,6 @@ export default function DeleteCollectionModal({
const deleteCollection = useDeleteCollection();
const submit = async () => {
- if (permissions === true && collection.name !== inputField) return;
if (!submitLoader) {
setSubmitLoader(true);
if (!collection) return null;
@@ -70,16 +68,7 @@ export default function DeleteCollectionModal({
<div className="flex flex-col gap-3">
{permissions === true ? (
<>
- <p>{t("confirm_deletion_prompt", { name: collection.name })}</p>
- <TextInput
- value={inputField}
- onChange={(e) => setInputField(e.target.value)}
- placeholder={t("type_name_placeholder", {
- name: collection.name,
- })}
- className="w-3/4 mx-auto"
- />
-
+ {t("collection_deletion_prompt")}
<div role="alert" className="alert alert-warning">
<i className="bi-exclamation-triangle text-xl"></i>
<span>
@@ -92,12 +81,7 @@ export default function DeleteCollectionModal({
<p>{t("leave_prompt")}</p>
)}
- <Button
- disabled={permissions === true && inputField !== collection.name}
- onClick={submit}
- variant="destructive"
- className="ml-auto"
- >
+ <Button onClick={submit} variant="destructive" className="ml-auto">
<i className="bi-trash text-xl"></i>
{permissions === true ? t("delete") : t("leave")}
</Button>
diff --git a/apps/web/public/locales/de/common.json b/apps/web/public/locales/de/common.json
index 94071852..2387af84 100644
--- a/apps/web/public/locales/de/common.json
+++ b/apps/web/public/locales/de/common.json
@@ -343,7 +343,6 @@
"shift_key_tip": "Halte die Umschalttaste gedrückt, während du auf „Löschen“ klickst, um diese Bestätigung in Zukunft zu umgehen.",
"deleting_collection": "Lösche...",
"collection_deleted": "Sammlung gelöscht.",
- "confirm_deletion_prompt": "Zur Bestätigung tippe „{{name}}“ in das Feld unten:",
"type_name_placeholder": "Tippe „{{name}}“ hier.",
"deletion_warning": "Wenn Du diese Sammlung löschst, wird ihr gesamter Inhalt unwiderruflich gelöscht und sie wird für jeden unzugänglich, auch für Mitglieder mit vorherigem Zugriff.",
"leave_prompt": "Klicke auf die Schaltfläche unten, um die aktuelle Sammlung zu verlassen.",
diff --git a/apps/web/public/locales/en/common.json b/apps/web/public/locales/en/common.json
index cecef692..a42668c9 100644
--- a/apps/web/public/locales/en/common.json
+++ b/apps/web/public/locales/en/common.json
@@ -344,7 +344,7 @@
"shift_key_tip": "Hold the Shift key while clicking 'Delete' to bypass this confirmation in the future.",
"deleting_collection": "Deleting...",
"collection_deleted": "Collection Deleted.",
- "confirm_deletion_prompt": "To confirm, type \"{{name}}\" in the box below:",
+ "collection_deletion_prompt": "Are you sure you want to delete this Collection?",
"type_name_placeholder": "Type \"{{name}}\" Here.",
"deletion_warning": "Deleting this collection will permanently erase all its contents, and it will become inaccessible to everyone, including members with previous access.",
"leave_prompt": "Click the button below to leave the current collection.",
diff --git a/apps/web/public/locales/es/common.json b/apps/web/public/locales/es/common.json
index 03e3faf1..e3fbada1 100644
--- a/apps/web/public/locales/es/common.json
+++ b/apps/web/public/locales/es/common.json
@@ -343,7 +343,6 @@
"shift_key_tip": "Mantén presionada la tecla 'Mayúscula' mientras haces clic en 'Eliminar' para omitir esta confirmación en el futuro.",
"deleting_collection": "Eliminando...",
"collection_deleted": "Colección eliminada.",
- "confirm_deletion_prompt": "Para confirmar, escribe \"{{name}}\" en el campo a continuación:",
"type_name_placeholder": "Escribe \"{{name}}\" aquí.",
"deletion_warning": "Eliminar esta colección borrará permanentemente todo su contenido, y se volverá inaccesible para todos, incluidos los miembros con acceso previamente.",
"leave_prompt": "Haz clic en el botón de abajo para abandonar la colección actual.",
diff --git a/apps/web/public/locales/fr/common.json b/apps/web/public/locales/fr/common.json
index 89497824..bc12a9d5 100644
--- a/apps/web/public/locales/fr/common.json
+++ b/apps/web/public/locales/fr/common.json
@@ -343,7 +343,6 @@
"shift_key_tip": "Maintenez la touche Majuscule enfoncée tout en cliquant sur « Supprimer » pour éviter cette confirmation à l’avenir.",
"deleting_collection": "Suppression...",
"collection_deleted": "Collection supprimée.",
- "confirm_deletion_prompt": "Pour confirmer, tapez \"{{name}}\" dans le champ ci-dessous:",
"type_name_placeholder": "Tapez \"{{name}}\" ici.",
"deletion_warning": "La suppression de cette collection effacera définitivement tout son contenu et deviendra inaccessible à tous, y compris aux membres qui y ont déjà eu accès.",
"leave_prompt": "Cliquez sur le bouton ci-dessous pour quitter la collection actuelle.",
diff --git a/apps/web/public/locales/it/common.json b/apps/web/public/locales/it/common.json
index 518f4efb..a2614e95 100644
--- a/apps/web/public/locales/it/common.json
+++ b/apps/web/public/locales/it/common.json
@@ -342,7 +342,6 @@
"shift_key_tip": "Tieni premuto il tasto Shift mentre clicchi su 'Elimina' per evitare questa conferma in futuro.",
"deleting_collection": "Eliminazione in corso...",
"collection_deleted": "Collezione Eliminata.",
- "confirm_deletion_prompt": "Per confermare, digita \"{{name}}\" nella casella sottostante:",
"type_name_placeholder": "Digita \"{{name}}\" Qui.",
"deletion_warning": "L'eliminazione di questa collezione cancellerà permanentemente tutti i suoi contenuti e diventerà inaccessibile a tutti, inclusi i membri con accesso precedente.",
"leave_prompt": "Clicca il pulsante sottostante per lasciare la collezione corrente.",
diff --git a/apps/web/public/locales/ja/common.json b/apps/web/public/locales/ja/common.json
index 10d2598e..70a5fadc 100644
--- a/apps/web/public/locales/ja/common.json
+++ b/apps/web/public/locales/ja/common.json
@@ -344,7 +344,6 @@
"shift_key_tip": "Shiftキーを押しながら「削除」をクリックすると、今後この確認をスキップできます。",
"deleting_collection": "削除中...",
"collection_deleted": "コレクションが削除されました。",
- "confirm_deletion_prompt": "確認のため、以下のボックスに \"{{name}}\" と入力してください:",
"type_name_placeholder": "ここに \"{{name}}\" を入力してください。",
"deletion_warning": "このコレクションを削除すると、そのすべての内容が永久に消去され、以前アクセス可能だったメンバーを含め、誰もアクセスできなくなります。",
"leave_prompt": "現在のコレクションから離れるには、以下のボタンをクリックしてください。",
diff --git a/apps/web/public/locales/nl/common.json b/apps/web/public/locales/nl/common.json
index aa25b3d6..9cf8d6e3 100644
--- a/apps/web/public/locales/nl/common.json
+++ b/apps/web/public/locales/nl/common.json
@@ -342,7 +342,6 @@
"shift_key_tip": "Houd de Shift-toets ingedrukt terwijl u op 'Verwijderen' klikt om deze bevestiging in de toekomst te omzeilen.",
"deleting_collection": "Verwijderen...",
"collection_deleted": "Collectie Verwijderd.",
- "confirm_deletion_prompt": "Ter bevestiging, typ \"{{name}}\" in het onderstaande vak:",
"type_name_placeholder": "Typ Hier \"{{name}}\".",
"deletion_warning": "Als u deze collectie verwijdert, worden alle inhoud permanent gewist, en wordt deze ontoegankelijk voor iedereen, inclusief leden met eerdere toegang.",
"leave_prompt": "Klik op de onderstaande knop om de huidige collectie te verlaten.",
diff --git a/apps/web/public/locales/pl/common.json b/apps/web/public/locales/pl/common.json
index 13abf693..7e04a749 100644
--- a/apps/web/public/locales/pl/common.json
+++ b/apps/web/public/locales/pl/common.json
@@ -343,7 +343,6 @@
"shift_key_tip": "Przytrzymaj klawisz Shift podczas klikania 'Usuń', aby w przyszłości pominąć to potwierdzenie.",
"deleting_collection": "Usuwanie...",
"collection_deleted": "Kolekcja usunięta.",
- "confirm_deletion_prompt": "Aby potwierdzić, wpisz \"{{name}}\" w polu poniżej:",
"type_name_placeholder": "Wpisz \"{{name}}\" tutaj.",
"deletion_warning": "Usunięcie tej kolekcji spowoduje trwałe usunięcie wszystkich jej zawartości i stanie się ona niedostępna dla wszystkich, w tym dla członków z poprzednim dostępem.",
"leave_prompt": "Kliknij przycisk poniżej, aby opuścić obecną kolekcję.",
diff --git a/apps/web/public/locales/pt-BR/common.json b/apps/web/public/locales/pt-BR/common.json
index bff28f6a..a92e3a9c 100644
--- a/apps/web/public/locales/pt-BR/common.json
+++ b/apps/web/public/locales/pt-BR/common.json
@@ -364,7 +364,6 @@
"show": "Exibir",
"deleting_collection": "Excluindo...",
"collection_deleted": "Coleção Excluída.",
- "confirm_deletion_prompt": "Para confirmar, digite \"{{name}}\" na caixa abaixo:",
"type_name_placeholder": "Digite \"{{name}}\" Aqui.",
"deletion_warning": "Excluir esta coleção apagará permanentemente todo o seu conteúdo e ela se tornará inacessível para todos, incluindo membros com acesso anterior.",
"leave_prompt": "Clique no botão abaixo para sair da coleção atual.",
diff --git a/apps/web/public/locales/ru/common.json b/apps/web/public/locales/ru/common.json
index 52d76b6d..2498256a 100644
--- a/apps/web/public/locales/ru/common.json
+++ b/apps/web/public/locales/ru/common.json
@@ -344,7 +344,6 @@
"shift_key_tip": "Щёлкая на 'Удалить' с зажатым SHIFT, можно пропустить этот диалог подтверждения.",
"deleting_collection": "Удаление...",
"collection_deleted": "Коллекция удалена.",
- "confirm_deletion_prompt": "Для подтверждения введите \"{{name}}\" в поле ниже:",
"type_name_placeholder": "Введите \"{{name}}\" здесь.",
"deletion_warning": "Удаление коллекции приведет и к полному удалению её содержимого, которое станет недоступным и для других пользователей, в том числе тех, у кого был соответствующий доступ.",
"leave_prompt": "Нажмите на кнопку ниже, чтобы покинуть текущую коллекцию.",
diff --git a/apps/web/public/locales/tr/common.json b/apps/web/public/locales/tr/common.json
index f596c394..a2cdaac6 100644
--- a/apps/web/public/locales/tr/common.json
+++ b/apps/web/public/locales/tr/common.json
@@ -343,7 +343,6 @@
"shift_key_tip": "Gelecekte bu onayı atlamak için 'Sil' tuşuna tıklarken Shift tuşunu basılı tutun.",
"deleting_collection": "Siliniyor...",
"collection_deleted": "Koleksiyon Silindi.",
- "confirm_deletion_prompt": "Onaylamak için aşağıdaki kutuya \"{{name}}\" yazın:",
"type_name_placeholder": "\"{{name}}\" Buraya Yazın.",
"deletion_warning": "Bu koleksiyonu silmek, tüm içeriğini kalıcı olarak silecek ve önceki erişime sahip üyeler dahil olmak üzere herkese erişilemez hale getirecektir.",
"leave_prompt": "Mevcut koleksiyondan ayrılmak için aşağıdaki düğmeye tıklayın.",
diff --git a/apps/web/public/locales/uk/common.json b/apps/web/public/locales/uk/common.json
index 3da5e853..c0c8c7d1 100644
--- a/apps/web/public/locales/uk/common.json
+++ b/apps/web/public/locales/uk/common.json
@@ -343,7 +343,6 @@
"shift_key_tip": "Утримуйте клавішу Shift під час натискання 'Видалити', щоб обійти це підтвердження в майбутньому.",
"deleting_collection": "Видалення...",
"collection_deleted": "Колекцію видалено.",
- "confirm_deletion_prompt": "Щоб підтвердити, введіть \"{{name}}\" у полі нижче:",
"type_name_placeholder": "Введіть \"{{name}}\" тут.",
"deletion_warning": "Видалення цієї колекції призведе до остаточного видалення всього її вмісту, і вона стане недоступною для всіх, включаючи учасників з попереднім доступом.",
"leave_prompt": "Натисніть кнопку нижче, щоб залишити поточну колекцію.",
diff --git a/apps/web/public/locales/zh-TW/common.json b/apps/web/public/locales/zh-TW/common.json
index 1607c826..9919ff12 100644
--- a/apps/web/public/locales/zh-TW/common.json
+++ b/apps/web/public/locales/zh-TW/common.json
@@ -344,7 +344,6 @@
"shift_key_tip": "按住 Shift 鍵再點選「刪除」可略過後續的確認步驟。",
"deleting_collection": "正在刪除收藏集...",
"collection_deleted": "收藏集已刪除。",
- "confirm_deletion_prompt": "請在下方輸入「{{name}}」以確認:",
"type_name_placeholder": "在此輸入「{{name}}」。",
"deletion_warning": "刪除此收藏集將永久移除其所有內容,且任何人都將無法存取,包括先前具有存取權限的成員。",
"leave_prompt": "點選下方按鈕離開目前的收藏集。",
diff --git a/apps/web/public/locales/zh/common.json b/apps/web/public/locales/zh/common.json
index a14ab226..117bad13 100644
--- a/apps/web/public/locales/zh/common.json
+++ b/apps/web/public/locales/zh/common.json
@@ -341,7 +341,6 @@
"shift_key_tip": "按住 Shift 键并单击“删除”即可在以后绕过此确认。",
"deleting_collection": "删除中...",
"collection_deleted": "收藏夹已删除。",
- "confirm_deletion_prompt": "请确认, 在下面的输入框中输入 \"{{name}}\" :",
"type_name_placeholder": "在此输入 \"{{name}}\" 。",
"deletion_warning": "删除此收藏夹将永久清除其所有内容,并且所有人都将无法访问,包括之前具有访问权限的成员。",
"leave_prompt": "单击下面的按钮离开当前收藏夹。",
diff --git a/apps/web/styles/globals.css b/apps/web/styles/globals.css
index 7037d3c2..80dfdd18 100644
--- a/apps/web/styles/globals.css
+++ b/apps/web/styles/globals.css
@@ -190,13 +190,20 @@
.menu li > details > summary {
@apply hover:!bg-base-content/10 hover:!text-inherit active:!bg-base-content/10 active:!text-base-content;
}
- /* .menu {
- @apply !rounded-md px-0 py-1 min-w-52;
+
+ .alert {
+ @apply rounded-md;
+ }
+
+ .alert-warning {
+ @apply bg-transparent border-yellow-400/50 text-yellow-400;
+ }
+ .alert-info {
+ @apply bg-transparent border-blue-400/50 text-blue-400;
+ }
+ .alert-note {
+ @apply bg-transparent border-base-content/50 text-base-content;
}
- .menu :where(li:not(.menu-title) > *:not(ul):not(details):not(.menu-title)),
- .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
- @apply rounded-none py-1;
- } */
}
.line-break * {