fix: handle edge case to display LinkedIn logo when used in Profiles

This commit is contained in:
Amruth Pillai
2025-01-12 13:24:57 +01:00
parent 3c4a26bc06
commit 35df043f66
71 changed files with 3213 additions and 3148 deletions

View File

@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
import get from "lodash.get";
import { Fragment } from "react";
import { BrandIcon } from "../components/brand-icon";
import { Picture } from "../components/picture";
import { useArtboardStore } from "../store/artboard";
import { TemplateProps } from "../types/template";
@ -271,26 +272,13 @@ const Section = <T,>({
const Profiles = () => {
const section = useArtboardStore((state) => state.resume.sections.profiles);
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
return (
<Section<Profile> section={section}>
{(item) => (
<div>
{isUrl(item.url.href) ? (
<Link
url={item.url}
label={item.username}
icon={
<img
className="ph"
width={fontSize}
height={fontSize}
alt={item.network}
src={`https://cdn.simpleicons.org/${item.icon}`}
/>
}
/>
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
) : (
<p>{item.username}</p>
)}