690 files changed
+12045
-33943
No files matched your search
@@ -0,0 +1,102 @@
|
||||
import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
||||
import {
|
||||
faAward,
|
||||
faBell,
|
||||
faBolt,
|
||||
faBriefcase,
|
||||
faBrush,
|
||||
faCalendarCheck,
|
||||
faCamera,
|
||||
faCheck,
|
||||
faCircleCheck,
|
||||
faClock,
|
||||
faCompass,
|
||||
faCrown,
|
||||
faDiamond,
|
||||
faFire,
|
||||
faGem,
|
||||
faGift,
|
||||
faGlassCheers,
|
||||
faHandSparkles,
|
||||
faHatCowboy,
|
||||
faHeart,
|
||||
faLeaf,
|
||||
faLightbulb,
|
||||
faMedal,
|
||||
faMugSaucer,
|
||||
faPaintbrush,
|
||||
faRibbon,
|
||||
faScissors,
|
||||
faShieldHeart,
|
||||
faSprayCanSparkles,
|
||||
faStamp,
|
||||
faStar,
|
||||
faStarHalfStroke,
|
||||
faSun,
|
||||
faTag,
|
||||
faThumbsUp,
|
||||
faTicket,
|
||||
faTrophy,
|
||||
faUserTie,
|
||||
faWandMagicSparkles,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
/**
|
||||
* Curated, not the full ~2000-icon Font Awesome solid set — deliberately:
|
||||
* a searchable picker over every icon Font Awesome ships (razors,
|
||||
* spreadsheets, ambulances...) is a worse experience for "pick a loyalty
|
||||
* stamp icon" than a relevant shortlist, and named imports here (rather
|
||||
* than `import { fas } from "..."`) keep only these icons' path data in
|
||||
* the bundle — this component is only ever loaded on the owner Loyalty
|
||||
* settings page, never the customer bundle, but there's no reason to
|
||||
* bundle 2000 unused icons regardless. Add to this list as new use cases
|
||||
* come up; nothing about IconPicker itself is tied to this specific set.
|
||||
*/
|
||||
export const ICON_CATALOG: IconDefinition[] = [
|
||||
faScissors,
|
||||
faStar,
|
||||
faStarHalfStroke,
|
||||
faHeart,
|
||||
faGift,
|
||||
faCrown,
|
||||
faGem,
|
||||
faDiamond,
|
||||
faAward,
|
||||
faMedal,
|
||||
faTrophy,
|
||||
faRibbon,
|
||||
faStamp,
|
||||
faTag,
|
||||
faTicket,
|
||||
faThumbsUp,
|
||||
faCheck,
|
||||
faCircleCheck,
|
||||
faFire,
|
||||
faBolt,
|
||||
faSun,
|
||||
faLeaf,
|
||||
faMugSaucer,
|
||||
faGlassCheers,
|
||||
faHandSparkles,
|
||||
faSprayCanSparkles,
|
||||
faWandMagicSparkles,
|
||||
faBrush,
|
||||
faPaintbrush,
|
||||
faCamera,
|
||||
faHatCowboy,
|
||||
faUserTie,
|
||||
faBriefcase,
|
||||
faShieldHeart,
|
||||
faLightbulb,
|
||||
faCompass,
|
||||
faClock,
|
||||
faCalendarCheck,
|
||||
faBell,
|
||||
];
|
||||
|
||||
const ICON_BY_NAME = new Map<string, IconDefinition>(ICON_CATALOG.map((icon) => [icon.iconName, icon]));
|
||||
|
||||
/** Falls back to a neutral default for anything not in the catalogue — covers legacy free-text values from before this picker existed. */
|
||||
export function findCatalogIcon(iconName: string | null | undefined): IconDefinition {
|
||||
return (iconName && ICON_BY_NAME.get(iconName)) || faScissors;
|
||||
}
|
||||
Reference in new issue
Block a user