From ac41dd4ebd0360226cd79d3a32ac5a142c45cf7f Mon Sep 17 00:00:00 2001 From: JOYCEQL <1449239013@qq.com> Date: Tue, 11 Mar 2025 23:55:48 +0800 Subject: [PATCH] feat: add email mailto link rendering --- src/components/preview/BaseInfo.tsx | 44 ++++++++++++++++------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/components/preview/BaseInfo.tsx b/src/components/preview/BaseInfo.tsx index 0f80b13..a393fec 100644 --- a/src/components/preview/BaseInfo.tsx +++ b/src/components/preview/BaseInfo.tsx @@ -6,7 +6,7 @@ import { cn } from "@/lib/utils"; import { BasicInfo, getBorderRadiusValue, - GlobalSettings + GlobalSettings, } from "@/types/resume"; import { ResumeTemplate } from "@/types/template"; import { useResumeStore } from "@/store/useResumeStore"; @@ -21,7 +21,7 @@ interface BaseInfoProps { const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, - template + template, }: BaseInfoProps) => { const t = useTranslations("workbench"); const locale = useLocale(); @@ -49,8 +49,8 @@ const BaseInfo = ({ icon: basic.icons?.email || "Mail", label: "电子邮箱", visible: true, - custom: false - } + custom: false, + }, ].filter((item) => Boolean(item.value && item.visible)); } @@ -70,7 +70,7 @@ const BaseInfo = ({ icon: basic.icons?.[field.key] || "User", label: field.label, visible: field.visible, - custom: field.custom + custom: field.custom, })) .filter((item) => Boolean(item.value)); }, [basic]); @@ -85,8 +85,8 @@ const BaseInfo = ({ icon: field.icon, label: field.label, visible: true, - custom: true - })) || []) + custom: true, + })) || []), ]; const getNameField = () => { @@ -95,7 +95,7 @@ const BaseInfo = ({ ) || { key: "name", label: "姓名", - visible: true + visible: true, }; return nameField.visible !== false ? nameField : null; }; @@ -106,7 +106,7 @@ const BaseInfo = ({ ) || { key: "title", label: "职位", - visible: true + visible: true, }; return titleField.visible !== false ? titleField : null; }; @@ -123,10 +123,10 @@ const BaseInfo = ({ borderRadius: getBorderRadiusValue( basic.photoConfig || { borderRadius: "none", - customBorderRadius: 0 + customBorderRadius: 0, } ), - overflow: "hidden" + overflow: "hidden", }} > {basic[nameField.key] as string} @@ -206,7 +206,7 @@ const BaseInfo = ({ {basic[titleField.key] as string} @@ -222,7 +222,7 @@ const BaseInfo = ({ style={{ fontSize: `${globalSettings?.baseFontSize || 14}px`, color: isModernTemplate ? "#fff" : "rgb(75, 85, 99)", - maxWidth: layout === "center" ? "none" : "600px" + maxWidth: layout === "center" ? "none" : "600px", }} > {allFields.map((item) => ( @@ -230,13 +230,19 @@ const BaseInfo = ({ key={item.key} className={cn(baseFieldItemClass, isModernTemplate && "text-[#fff]")} style={{ - width: isModernTemplate ? "100%" : "" + width: isModernTemplate ? "100%" : "", }} > {useIconMode ? (
{getIcon(item.icon)} - {item.value} + {item.key === "email" ? ( + + {item.value} + + ) : ( + {item.value} + )}
) : (