mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-02 02:19:43 +00:00
Update icons, screenshots, and UX improvements
- Refactor icon picker to use full Ionicons set dynamically - Add date sort toggle to My Answers screen - Fix match deduplication and show total count on home - Clear stale data when switching chats - Update app store screenshots - Bump build number to 25 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c48936686e
commit
b60b72a289
64 files changed
+381
-298
No files matched your search
@@ -1,7 +1,15 @@
|
||||
import type { Ionicons } from "@expo/vector-icons";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
|
||||
type IoniconsName = keyof typeof Ionicons.glyphMap;
|
||||
|
||||
/**
|
||||
* Checks if a string is a valid Ionicons name.
|
||||
* Uses the actual Ionicons.glyphMap for runtime validation.
|
||||
*/
|
||||
function isValidIonicon(name: string): name is IoniconsName {
|
||||
return name in Ionicons.glyphMap;
|
||||
}
|
||||
|
||||
// Legacy emoji mappings (for backwards compatibility with existing packs)
|
||||
const EMOJI_TO_IONICON: Record<string, IoniconsName> = {
|
||||
// Career & Professional
|
||||
@@ -49,63 +57,20 @@ export const PACK_ICON_MAP = EMOJI_TO_IONICON;
|
||||
|
||||
export const DEFAULT_PACK_ICON: IoniconsName = "layers-outline";
|
||||
|
||||
// List of valid Ionicon names (subset we support)
|
||||
const VALID_IONICONS = new Set([
|
||||
"heart-outline",
|
||||
"heart-half-outline",
|
||||
"heart-circle-outline",
|
||||
"chatbubbles-outline",
|
||||
"chatbox-outline",
|
||||
"mail-outline",
|
||||
"flower-outline",
|
||||
"wine-outline",
|
||||
"restaurant-outline",
|
||||
"cafe-outline",
|
||||
"airplane-outline",
|
||||
"car-outline",
|
||||
"compass-outline",
|
||||
"map-outline",
|
||||
"home-outline",
|
||||
"people-outline",
|
||||
"person-outline",
|
||||
"eye-off-outline",
|
||||
"key-outline",
|
||||
"lock-closed-outline",
|
||||
"dice-outline",
|
||||
"gift-outline",
|
||||
"sparkles-outline",
|
||||
"star-outline",
|
||||
"flame-outline",
|
||||
"flash-outline",
|
||||
"moon-outline",
|
||||
"sunny-outline",
|
||||
"flag-outline",
|
||||
"calendar-outline",
|
||||
"checkbox-outline",
|
||||
"trophy-outline",
|
||||
"layers-outline",
|
||||
"cube-outline",
|
||||
"folder-outline",
|
||||
"bookmark-outline",
|
||||
"bulb-outline",
|
||||
"color-wand-outline",
|
||||
"sync-outline",
|
||||
"refresh-outline",
|
||||
"briefcase-outline",
|
||||
]);
|
||||
|
||||
/**
|
||||
* Converts an icon value to an Ionicons name.
|
||||
* Handles both:
|
||||
* - Ionicon names directly (new packs): "briefcase-outline" -> "briefcase-outline"
|
||||
* - Any valid Ionicon name directly: "briefcase-outline" -> "briefcase-outline"
|
||||
* - Legacy emojis (existing packs): "💼" -> "briefcase-outline"
|
||||
*/
|
||||
export function getPackIconName(icon: string | null | undefined): IoniconsName {
|
||||
if (!icon) return DEFAULT_PACK_ICON;
|
||||
|
||||
if (VALID_IONICONS.has(icon)) {
|
||||
return icon as IoniconsName;
|
||||
// Check if it's a valid Ionicon name (supports the full Ionicons set)
|
||||
if (isValidIonicon(icon)) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
// Fall back to emoji mapping for legacy packs
|
||||
return EMOJI_TO_IONICON[icon] || DEFAULT_PACK_ICON;
|
||||
}
|
||||
Reference in new issue
Block a user