@@ -3,15 +3,18 @@ import { FaLock } from 'react-icons/fa';
33import * as icons from 'simple-icons' ;
44import { twJoin } from 'tailwind-merge' ;
55
6+ import accrue from '../images/accrue.svg?raw' ;
7+ import amazon from '../images/amazon.svg?raw' ;
68import bastillion from '../images/bastillion.png' ;
79import betterment from '../images/betterment.png' ;
810import carta from '../images/carta.png' ;
911import guideline from '../images/guideline.png' ;
1012import idme from '../images/id.me.png' ;
1113import justworks from '../images/justworks.jpg' ;
12- import microsoft from '../images/microsoft.png' ;
14+ import microsoft from '../images/microsoft.svg?raw' ;
15+ import nintendo from '../images/nintendo.svg?raw' ;
1316import sequoia from '../images/sequoia.png' ;
14- import twitter from '../images/twitter.png ' ;
17+ import twitter from '../images/twitter.svg?raw ' ;
1518import uwcu from '../images/uwcu.png' ;
1619
1720enum IconType {
@@ -24,12 +27,12 @@ interface Icon {
2427 hex : string ;
2528 title : string ;
2629 type : IconType . Icon ;
27- padding ?: boolean ;
30+ padding ?: boolean | string ;
2831}
2932
3033interface Image {
3134 url : string ;
32- padding ?: boolean ;
35+ padding ?: boolean | string ;
3336 type : IconType . Image ;
3437}
3538
@@ -51,6 +54,10 @@ function getIcon(name?: string): Icon | Image | undefined {
5154
5255 // handle one-off cases
5356 switch ( name . toLowerCase ( ) ) {
57+ case 'accrue' :
58+ return { svg : accrue , title : 'Accrue' , hex : 'ffffff' , padding : 'p-2' , type : IconType . Icon } ;
59+ case 'amazon' :
60+ return { svg : amazon , title : 'Amazon' , hex : 'ff9900' , padding : true , type : IconType . Icon } ;
5461 case 'bastillion' :
5562 return { url : bastillion , padding : true , type : IconType . Image } ;
5663 case 'betterment' :
@@ -66,17 +73,19 @@ function getIcon(name?: string): Icon | Image | undefined {
6673 case 'justworks' :
6774 return { url : justworks , type : IconType . Image } ;
6875 case 'microsoft' :
69- return { url : microsoft , padding : true , type : IconType . Image } ;
76+ return { svg : microsoft , title : 'Microsoft' , hex : '727272' , padding : 'p-1.5' , type : IconType . Icon } ;
77+ case 'nintendo' :
78+ return { svg : nintendo , title : 'Nintendo' , hex : 'dd2020' , padding : 'p-1' , type : IconType . Icon } ;
7079 case 'nas' :
7180 case 'synology' :
72- return { ...icons . siSynology , type : IconType . Icon } ;
81+ return { ...icons . siSynology , padding : 'p-1.5' , type : IconType . Icon } ;
7382 case 'uw credit union' :
7483 case 'uwcu' :
7584 return { url : uwcu , padding : true , type : IconType . Image } ;
7685 case 'sequoia' :
7786 return { url : sequoia , padding : true , type : IconType . Image } ;
7887 case 'twitter' :
79- return { url : twitter , padding : true , type : IconType . Image } ;
88+ return { svg : twitter , title : 'Twitter' , hex : '00aced' , padding : true , type : IconType . Icon } ;
8089 default :
8190 break ;
8291 }
@@ -95,9 +104,6 @@ function getColors(i?: Icon | Image): { background: string; fill?: string } {
95104
96105 // handle one-off cases
97106 switch ( icon . title . toLowerCase ( ) ) {
98- case 'amazon' :
99- background = darkColor ;
100- break ;
101107 case 'epic games' :
102108 fill = 'white' ;
103109 break ;
@@ -122,20 +128,24 @@ export function AppIcon({ name, className }: { name: string; className?: string
122128 ' ' +
123129 className ;
124130
125- if ( ! icon )
131+ if ( ! icon ) {
132+ console . warn ( `No icon found for ${ name } ` ) ;
126133 return (
127134 < div className = { imgClass } >
128135 < FaLock />
129136 </ div >
130137 ) ;
138+ }
139+
140+ const padding = typeof icon . padding === 'string' ? icon . padding : undefined ;
131141
132142 if ( icon . type === IconType . Image )
133- return < img src = { icon . url } className = { twJoin ( imgClass , 'object-cover' , icon . padding && 'p-1' ) } /> ;
143+ return < img src = { icon . url } className = { twJoin ( imgClass , 'object-cover' , padding || ( icon . padding && 'p-1' ) ) } /> ;
134144
135145 return (
136146 < div
137147 dangerouslySetInnerHTML = { { __html : icon . svg } }
138- className = { twJoin ( imgClass , icon . padding ? 'p-2.5' : 'p-0.5' ) }
148+ className = { twJoin ( imgClass , padding || ( icon . padding ? 'p-2.5' : 'p-0.5' ) ) }
139149 style = { { fill : colors . fill } }
140150 />
141151 ) ;
0 commit comments