fix: show neutral badge for categories without assigned colors

- Categories without colors now show gray badge instead of no badge
- Categories with colors show colored badge as before
- Bump version to 0.2.0
This commit is contained in:
drelich
2026-03-25 20:08:47 +01:00
parent 4dbf0233b7
commit 4f13b0d57f
3 changed files with 11 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "nextcloud-notes-tauri", "name": "nextcloud-notes-tauri",
"private": true, "private": true,
"version": "0.1.5", "version": "0.2.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Nextcloud Notes", "productName": "Nextcloud Notes",
"version": "0.1.5", "version": "0.2.0",
"identifier": "com.davidrelich.nextcloud-notes", "identifier": "com.davidrelich.nextcloud-notes",
"build": { "build": {
"beforeDevCommand": "npm run dev", "beforeDevCommand": "npm run dev",

View File

@@ -296,12 +296,19 @@ export function NotesList({
<span>{formatDate(note.modified)}</span> <span>{formatDate(note.modified)}</span>
{note.category && (() => { {note.category && (() => {
const colors = getCategoryColor(note.category); const colors = getCategoryColor(note.category);
if (!colors) return null; if (colors) {
return ( return (
<span className={`px-2 py-0.5 ${colors.bg} ${colors.text} rounded-full text-xs font-medium`}> <span className={`px-2 py-0.5 ${colors.bg} ${colors.text} rounded-full text-xs font-medium`}>
{note.category} {note.category}
</span> </span>
); );
}
// Show neutral badge when no color is set
return (
<span className="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded-full text-xs font-medium">
{note.category}
</span>
);
})()} })()}
</div> </div>