diff options
| -rw-r--r-- | common/helpers.ts | 4 | ||||
| -rw-r--r-- | src/components/preview/card.tsx | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/common/helpers.ts b/common/helpers.ts index 029df25..208b3f6 100644 --- a/common/helpers.ts +++ b/common/helpers.ts @@ -96,7 +96,9 @@ const getSimpleIconsImageURI = function (language: string, theme: Theme) { const icon = LANGUAGE_ICON_MAPPING[language] if (!icon) return undefined - const iconColor = theme === Theme.light ? `#${icon.hex}` : `#${icon.hex}` + const iconColor = + language === 'GitHub' && theme === Theme.dark ? '#fff' : `#${icon.hex}` + const iconSvg = icon.svg.replace('<svg ', `<svg fill="${iconColor}" `) return `data:image/svg+xml,${encodeURIComponent(iconSvg)}` diff --git a/src/components/preview/card.tsx b/src/components/preview/card.tsx index a5ddf5c..e584880 100644 --- a/src/components/preview/card.tsx +++ b/src/components/preview/card.tsx @@ -32,6 +32,7 @@ const Card = (config: Configuration) => { : nameLength > 25 ? '30px' : '40px' + console.log(config.theme) return ( <div @@ -96,6 +97,18 @@ const Card = (config: Configuration) => { }} /> )} + {/* show github logo if no language is selected */} + {!languageIconImageURI && !language2IconImageURI && ( + <img + src={config.logo || getSimpleIconsImageURI('GitHub', config.theme)} + alt="Logo" + width={100} + height={100} + style={{ + objectFit: 'contain' + }} + /> + )} </div> {/* Name */} |
