feat(06-02): replace EmojiPicker with IconPicker across all category components
- CategoryPicker shows LucideIcon prefix and uses IconPicker for inline create - CategoryHeader displays LucideIcon in view mode and IconPicker in edit mode - OnboardingWizard uses IconPicker for category creation step - CreateThreadModal drops emoji from category select options - Fixed categoryEmoji -> categoryIcon in routes and useCategories hook Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { useState } from "react";
|
||||
import { useCreateCategory } from "../hooks/useCategories";
|
||||
import { useCreateItem } from "../hooks/useItems";
|
||||
import { useUpdateSetting } from "../hooks/useSettings";
|
||||
import { IconPicker } from "./IconPicker";
|
||||
|
||||
interface OnboardingWizardProps {
|
||||
onComplete: () => void;
|
||||
@@ -12,7 +13,7 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
|
||||
|
||||
// Step 2 state
|
||||
const [categoryName, setCategoryName] = useState("");
|
||||
const [categoryEmoji, setCategoryEmoji] = useState("");
|
||||
const [categoryIcon, setCategoryIcon] = useState("");
|
||||
const [categoryError, setCategoryError] = useState("");
|
||||
const [createdCategoryId, setCreatedCategoryId] = useState<number | null>(null);
|
||||
|
||||
@@ -41,7 +42,7 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
|
||||
}
|
||||
setCategoryError("");
|
||||
createCategory.mutate(
|
||||
{ name, emoji: categoryEmoji.trim() || undefined },
|
||||
{ name, icon: categoryIcon.trim() || undefined },
|
||||
{
|
||||
onSuccess: (created) => {
|
||||
setCreatedCategoryId(created.id);
|
||||
@@ -164,20 +165,13 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label
|
||||
htmlFor="onboard-cat-emoji"
|
||||
className="block text-sm font-medium text-gray-700 mb-1"
|
||||
>
|
||||
Emoji (optional)
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
Icon (optional)
|
||||
</label>
|
||||
<input
|
||||
id="onboard-cat-emoji"
|
||||
type="text"
|
||||
value={categoryEmoji}
|
||||
onChange={(e) => setCategoryEmoji(e.target.value)}
|
||||
className="w-20 px-3 py-2 border border-gray-200 rounded-lg text-center text-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
placeholder="⛺"
|
||||
maxLength={4}
|
||||
<IconPicker
|
||||
value={categoryIcon}
|
||||
onChange={setCategoryIcon}
|
||||
size="md"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user