perf: simplify subtitle rendering logic and ensure date display consistency across sections

This commit is contained in:
JOYCEQL
2025-03-07 14:22:20 +08:00
committed by qingchen
parent 4cf7c97dc4
commit b94e22fd45
3 changed files with 8 additions and 14 deletions
+4 -6
View File
@@ -67,17 +67,15 @@ const CustomSection = ({
</h4>
</div>
{centerSubtitle && item.subtitle && (
{centerSubtitle && (
<motion.div layout="position" className="text-subtitleFont">
{item.subtitle}
</motion.div>
)}
{
<span className="text-subtitleFont shrink-0">
{item.dateRange}
</span>
}
<span className="text-subtitleFont shrink-0">
{item.dateRange}
</span>
</motion.div>
{!centerSubtitle && item.subtitle && (
+2 -4
View File
@@ -37,14 +37,12 @@ const ExperienceItem = React.forwardRef<HTMLDivElement, ExperienceItemProps>(
>
{experience.company}
</div>
{experience.position && centerSubtitle && (
{centerSubtitle && (
<motion.div className="text-subtitleFont">
{experience.position}
</motion.div>
)}
{experience.date && (
<div className="text-subtitleFont">{experience.date}</div>
)}
<div className="text-subtitleFont">{experience.date}</div>
</motion.div>
{experience.position && !centerSubtitle && (
<motion.div className="text-subtitleFont">
+2 -4
View File
@@ -51,14 +51,12 @@ const ProjectItem = React.forwardRef<HTMLDivElement, ProjectItemProps>(
</a>
)}
</div>
{project.role && globalSettings?.centerSubtitle && (
{globalSettings?.centerSubtitle && (
<motion.div layout="position" className=" text-subtitleFont">
{project.role}
</motion.div>
)}
{project.date && (
<div className="text-subtitleFont">{project.date}</div>
)}
<div className="text-subtitleFont">{project.date}</div>
</motion.div>
{project.role && !centerSubtitle && (
<motion.div layout="position" className=" text-subtitleFont">