fix(nx-dev): fix heroicons for safari (#29544)

This commit is contained in:
Mike Hartington 2025-01-08 08:03:31 -05:00 committed by GitHub
parent 5157a0daf9
commit 97e1e3bc50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -101,9 +101,9 @@ export function Cards({
); );
} }
function callIfFunction(fn: any) { function callIfFunction(fn: any, props: { [key: string]: string } = {}) {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn({}); return fn(props);
} }
return fn; return fn;
} }
@ -142,7 +142,8 @@ export function LinkCard({
(frameworkIcons[icon as Framework]?.image || (frameworkIcons[icon as Framework]?.image ||
callIfFunction(nxDevIcons[icon as keyof typeof nxDevIcons]) || callIfFunction(nxDevIcons[icon as keyof typeof nxDevIcons]) ||
callIfFunction( callIfFunction(
(heroIcons[icon as keyof typeof heroIcons] as any)?.render (heroIcons[icon as keyof typeof heroIcons] as any)?.render,
{ className: 'w-full h-full' }
))} ))}
</div> </div>
)} )}