diff --git a/apps/artboard/src/templates/azurill.tsx b/apps/artboard/src/templates/azurill.tsx index 71ab30c8..c79fc752 100644 --- a/apps/artboard/src/templates/azurill.tsx +++ b/apps/artboard/src/templates/azurill.tsx @@ -117,16 +117,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && ( icon ?? )} { > {label || url.label || url.href} + {iconOnRight && ( icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -205,7 +236,7 @@ const Section = ({

{keywords.join(", ")}

)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
@@ -255,7 +286,7 @@ const Experience = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.company}
+
{item.position}
{item.location}
{item.date}
@@ -272,7 +303,7 @@ const Education = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
{item.studyType}
@@ -291,7 +322,7 @@ const Awards = () => { {(item) => (
{item.title}
-
{item.awarder}
+
{item.date}
)} @@ -303,11 +334,11 @@ const Certifications = () => { const section = useArtboardStore((state) => state.resume.sections.certifications); return ( - section={section} urlKey="url" summaryKey="summary"> + section={section} urlKey="url" summaryKey="summary"> {(item) => (
{item.name}
-
{item.issuer}
+
{item.date}
)} @@ -347,7 +378,7 @@ const Publications = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.publisher}
{item.date}
@@ -363,7 +394,7 @@ const Volunteer = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.organization}
+
{item.position}
{item.location}
{item.date}
@@ -396,7 +427,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
{item.date}
@@ -414,7 +445,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -435,7 +466,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
{item.date}
diff --git a/apps/artboard/src/templates/bronzor.tsx b/apps/artboard/src/templates/bronzor.tsx index 34b4a453..e5790300 100644 --- a/apps/artboard/src/templates/bronzor.tsx +++ b/apps/artboard/src/templates/bronzor.tsx @@ -7,6 +7,7 @@ import { Experience, Interest, Language, + Metadata, Profile, Project, Publication, @@ -108,16 +109,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -173,7 +205,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -233,7 +265,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -255,10 +287,10 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
-
+
{item.date}
@@ -279,7 +311,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -300,7 +332,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -345,7 +377,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -366,7 +398,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -403,7 +435,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -423,7 +455,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -444,7 +476,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/chikorita.tsx b/apps/artboard/src/templates/chikorita.tsx index 06b5e760..c717f7e3 100644 --- a/apps/artboard/src/templates/chikorita.tsx +++ b/apps/artboard/src/templates/chikorita.tsx @@ -111,16 +111,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -174,7 +205,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -202,7 +233,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -224,7 +255,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -280,7 +311,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -302,6 +333,7 @@ const Certifications = () => {
{item.name}
{item.issuer}
+
@@ -346,7 +378,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -367,7 +399,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -404,7 +436,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -424,7 +456,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -445,7 +477,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/ditto.tsx b/apps/artboard/src/templates/ditto.tsx index 3d8dc9bd..e2f63262 100644 --- a/apps/artboard/src/templates/ditto.tsx +++ b/apps/artboard/src/templates/ditto.tsx @@ -128,16 +128,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -195,7 +226,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
@@ -260,7 +291,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -282,7 +313,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -306,7 +337,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -327,7 +358,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -372,7 +403,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -393,7 +424,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -430,7 +461,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -450,7 +481,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -471,7 +502,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/gengar.tsx b/apps/artboard/src/templates/gengar.tsx index a40c7810..75736ddb 100644 --- a/apps/artboard/src/templates/gengar.tsx +++ b/apps/artboard/src/templates/gengar.tsx @@ -106,16 +106,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -169,7 +200,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -229,7 +260,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -251,7 +282,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -275,7 +306,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -296,7 +327,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -341,7 +372,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -362,7 +393,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -399,7 +430,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -419,7 +450,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -440,7 +471,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/glalie.tsx b/apps/artboard/src/templates/glalie.tsx index e135020d..f5e339e2 100644 --- a/apps/artboard/src/templates/glalie.tsx +++ b/apps/artboard/src/templates/glalie.tsx @@ -114,16 +114,17 @@ const Rating = ({ level }: RatingProps) => { type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -179,7 +210,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -207,7 +238,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -229,7 +260,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -285,7 +316,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -306,7 +337,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -351,7 +382,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -372,7 +403,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -409,7 +440,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -429,7 +460,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -450,7 +481,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/kakuna.tsx b/apps/artboard/src/templates/kakuna.tsx index b3d774da..d09ce544 100644 --- a/apps/artboard/src/templates/kakuna.tsx +++ b/apps/artboard/src/templates/kakuna.tsx @@ -134,16 +134,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -209,7 +240,7 @@ const Section = ({

{keywords.join(", ")}

)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
); })} @@ -225,7 +256,7 @@ const Experience = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.company}
+
{item.position}
{item.location}
{item.date}
@@ -242,7 +273,7 @@ const Education = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
{item.studyType}
@@ -261,7 +292,7 @@ const Awards = () => { {(item) => (
{item.title}
-
{item.awarder}
+
{item.date}
)} @@ -277,7 +308,7 @@ const Certifications = () => { {(item) => (
{item.name}
-
{item.issuer}
+
{item.date}
)} @@ -317,7 +348,7 @@ const Publications = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.publisher}
{item.date}
@@ -333,7 +364,7 @@ const Volunteer = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.organization}
+
{item.position}
{item.location}
{item.date}
@@ -366,7 +397,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
{item.date}
@@ -383,7 +414,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -404,7 +435,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
{item.location}
{item.date}
diff --git a/apps/artboard/src/templates/leafish.tsx b/apps/artboard/src/templates/leafish.tsx index 8e50d85f..98fa75c1 100644 --- a/apps/artboard/src/templates/leafish.tsx +++ b/apps/artboard/src/templates/leafish.tsx @@ -131,16 +131,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && ( icon ?? )} { > {label || url.label || url.href} + {iconOnRight && ( icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -206,7 +237,7 @@ const Section = ({

{keywords.join(", ")}

)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
); })} @@ -222,7 +253,7 @@ const Experience = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.company}
+
{item.position}
{item.location}
{item.date}
@@ -239,7 +270,7 @@ const Education = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
{item.studyType}
@@ -258,7 +289,7 @@ const Awards = () => { {(item) => (
{item.title}
-
{item.awarder}
+
{item.date}
)} @@ -274,7 +305,7 @@ const Certifications = () => { {(item) => (
{item.name}
-
{item.issuer}
+
{item.date}
)} @@ -314,7 +345,7 @@ const Publications = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.publisher}
{item.date}
@@ -330,7 +361,7 @@ const Volunteer = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.organization}
+
{item.position}
{item.location}
{item.date}
@@ -363,7 +394,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
{item.date}
@@ -380,7 +411,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -401,7 +432,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
{item.location}
{item.date}
diff --git a/apps/artboard/src/templates/nosepass.tsx b/apps/artboard/src/templates/nosepass.tsx index cb7f99a9..a88c6dd0 100644 --- a/apps/artboard/src/templates/nosepass.tsx +++ b/apps/artboard/src/templates/nosepass.tsx @@ -110,16 +110,17 @@ const Summary = () => { type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && (icon ?? )} { > {label || url.label || url.href} + {iconOnRight && (icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -184,7 +215,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && } {summary !== undefined && !isEmptyString(summary) && (
@@ -219,7 +250,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && } {summary !== undefined && !isEmptyString(summary) && (
@@ -277,7 +308,7 @@ const Experience = () => { section={section} urlKey="url" dateKey="date" summaryKey="summary"> {(item) => (
-
{item.company}
+
{item.position}
{item.location}
@@ -293,7 +324,7 @@ const Education = () => { section={section} urlKey="url" dateKey="date" summaryKey="summary"> {(item) => (
-
{item.institution}
+
{item.area}
{item.studyType}
{item.score}
@@ -311,7 +342,7 @@ const Awards = () => { {(item) => (
{item.title}
-
{item.awarder}
+
)} @@ -326,7 +357,7 @@ const Certifications = () => { {(item) => (
{item.name}
-
{item.issuer}
+
)} @@ -365,7 +396,7 @@ const Publications = () => { section={section} urlKey="url" dateKey="date" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.publisher}
)} @@ -380,7 +411,7 @@ const Volunteer = () => { section={section} urlKey="url" dateKey="date" summaryKey="summary"> {(item) => (
-
{item.organization}
+
{item.position}
{item.location}
@@ -417,7 +448,7 @@ const Projects = () => { > {(item) => (
-
{item.name}
+
{item.description}
)} @@ -432,7 +463,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -453,7 +484,7 @@ const Custom = ({ id }: { id: string }) => { > {(item) => (
-
{item.name}
+
{item.description}
{item.location}
diff --git a/apps/artboard/src/templates/onyx.tsx b/apps/artboard/src/templates/onyx.tsx index 4b34256d..8c90a947 100644 --- a/apps/artboard/src/templates/onyx.tsx +++ b/apps/artboard/src/templates/onyx.tsx @@ -137,16 +137,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && ( icon ?? )} { > {label || url.label || url.href} + {iconOnRight && ( icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -200,7 +231,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -228,7 +259,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -250,7 +281,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -274,7 +305,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -295,7 +326,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -340,7 +371,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -361,7 +392,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -398,7 +429,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -418,7 +449,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -439,7 +470,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/pikachu.tsx b/apps/artboard/src/templates/pikachu.tsx index dcc0b919..9e0f2a3c 100644 --- a/apps/artboard/src/templates/pikachu.tsx +++ b/apps/artboard/src/templates/pikachu.tsx @@ -137,16 +137,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && ( icon ?? )} { > {label || url.label || url.href} + {iconOnRight && ( icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -200,7 +231,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -260,7 +291,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -282,7 +313,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -306,7 +337,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -327,7 +358,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -372,7 +403,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -393,7 +424,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -430,7 +461,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -450,7 +481,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -471,7 +502,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/artboard/src/templates/rhyhorn.tsx b/apps/artboard/src/templates/rhyhorn.tsx index beaeba27..e93a74a5 100644 --- a/apps/artboard/src/templates/rhyhorn.tsx +++ b/apps/artboard/src/templates/rhyhorn.tsx @@ -109,16 +109,17 @@ const Rating = ({ level }: RatingProps) => ( type LinkProps = { url: URL; icon?: React.ReactNode; + iconOnRight?: boolean; label?: string; className?: string; }; -const Link = ({ url, icon, label, className }: LinkProps) => { +const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => { if (!isUrl(url.href)) return null; return (
- {icon ?? } + {!iconOnRight && ( icon ?? )} { > {label || url.label || url.href} + {iconOnRight && ( icon ?? )}
); }; +type LinkedEntityProps = { + name: string; + url: URL; + separateLinks: boolean; + className?: string; +}; + +const LinkedEntity = ({ name, url, separateLinks, className}: LinkedEntityProps) => { + if (!separateLinks && isUrl(url.href)) { + return ( + + } + iconOnRight={true} + className={className} + /> + ); + } else { + return ( +
+ {name} +
+ ); + } +}; + type SectionProps = { section: SectionWithItem | CustomSectionGroup; children?: (item: T) => React.ReactNode; @@ -172,7 +203,7 @@ const Section = ({
{children?.(item as T)} - {url !== undefined && } + {url !== undefined && section.separateLinks && }
{summary !== undefined && !isEmptyString(summary) && ( @@ -232,7 +263,7 @@ const Experience = () => { {(item) => (
-
{item.company}
+
{item.position}
@@ -254,7 +285,7 @@ const Education = () => { {(item) => (
-
{item.institution}
+
{item.area}
{item.score}
@@ -278,7 +309,7 @@ const Awards = () => {
{item.title}
-
{item.awarder}
+
@@ -299,7 +330,7 @@ const Certifications = () => {
{item.name}
-
{item.issuer}
+
@@ -344,7 +375,7 @@ const Publications = () => { {(item) => (
-
{item.name}
+
{item.publisher}
@@ -365,7 +396,7 @@ const Volunteer = () => { {(item) => (
-
{item.organization}
+
{item.position}
@@ -402,7 +433,7 @@ const Projects = () => { {(item) => (
-
{item.name}
+
{item.description}
@@ -422,7 +453,7 @@ const References = () => { section={section} urlKey="url" summaryKey="summary"> {(item) => (
-
{item.name}
+
{item.description}
)} @@ -443,7 +474,7 @@ const Custom = ({ id }: { id: string }) => { {(item) => (
-
{item.name}
+
{item.description}
diff --git a/apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx b/apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx index 7bcdb889..659f912b 100644 --- a/apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx +++ b/apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx @@ -10,10 +10,11 @@ import { Plus, TrashSimple, } from "@phosphor-icons/react"; -import { defaultSections, SectionKey, SectionWithItem } from "@reactive-resume/schema"; +import { defaultSections, SectionKey, sectionsSchema, SectionWithItem } from "@reactive-resume/schema"; import { Button, DropdownMenu, + DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, @@ -31,6 +32,9 @@ import { useMemo } from "react"; import { useDialog } from "@/client/stores/dialog"; import { useResumeStore } from "@/client/stores/resume"; +import { DropdownMenuItemIndicator } from "@radix-ui/react-dropdown-menu"; +import { CheckboxIndicator } from "@radix-ui/react-checkbox"; +import { itemsEqual } from "@dnd-kit/sortable/dist/utilities"; type Props = { id: SectionKey }; @@ -47,6 +51,7 @@ export const SectionOptions = ({ id }: Props) => { const isCustomSection = useMemo(() => id.startsWith("custom"), [id]); const onCreate = () => open("create", { id }); + const toggleSeperateLinks = (checked: boolean) => setValue(`sections.${id}.separateLinks`, checked); const toggleVisibility = () => setValue(`sections.${id}.visible`, !section.visible); const onResetName = () => setValue(`sections.${id}.name`, originalName); const onChangeColumns = (value: string) => setValue(`sections.${id}.columns`, Number(value)); @@ -67,7 +72,12 @@ export const SectionOptions = ({ id }: Props) => { {t`Add a new item`} - + + {t`Separate Links`} + )} diff --git a/libs/schema/src/sample.ts b/libs/schema/src/sample.ts index 4e5c33c1..c7896c5e 100644 --- a/libs/schema/src/sample.ts +++ b/libs/schema/src/sample.ts @@ -28,6 +28,7 @@ export const sampleResume: ResumeData = { summary: { name: "Summary", columns: 1, + separateLinks: true, visible: true, id: "summary", content: @@ -36,6 +37,7 @@ export const sampleResume: ResumeData = { awards: { name: "Awards", columns: 1, + separateLinks: true, visible: true, id: "awards", items: [], @@ -43,6 +45,7 @@ export const sampleResume: ResumeData = { certifications: { name: "Certifications", columns: 1, + separateLinks: true, visible: true, id: "certifications", items: [ @@ -75,6 +78,7 @@ export const sampleResume: ResumeData = { education: { name: "Education", columns: 1, + separateLinks: true, visible: true, id: "education", items: [ @@ -97,6 +101,7 @@ export const sampleResume: ResumeData = { experience: { name: "Experience", columns: 1, + separateLinks: true, visible: true, id: "experience", items: [ @@ -133,6 +138,7 @@ export const sampleResume: ResumeData = { volunteer: { name: "Volunteering", columns: 1, + separateLinks: true, visible: true, id: "volunteer", items: [], @@ -140,6 +146,7 @@ export const sampleResume: ResumeData = { interests: { name: "Interests", columns: 1, + separateLinks: true, visible: true, id: "interests", items: [], @@ -147,6 +154,7 @@ export const sampleResume: ResumeData = { languages: { name: "Languages", columns: 1, + separateLinks: true, visible: true, id: "languages", items: [], @@ -154,6 +162,7 @@ export const sampleResume: ResumeData = { profiles: { name: "Profiles", columns: 1, + separateLinks: true, visible: true, id: "profiles", items: [ @@ -184,6 +193,7 @@ export const sampleResume: ResumeData = { projects: { name: "Projects", columns: 1, + separateLinks: true, visible: true, id: "projects", items: [ @@ -220,6 +230,7 @@ export const sampleResume: ResumeData = { publications: { name: "Publications", columns: 1, + separateLinks: true, visible: true, id: "publications", items: [], @@ -227,6 +238,7 @@ export const sampleResume: ResumeData = { references: { name: "References", columns: 1, + separateLinks: true, visible: false, id: "references", items: [ @@ -246,6 +258,7 @@ export const sampleResume: ResumeData = { skills: { name: "Skills", columns: 1, + separateLinks: true, visible: true, id: "skills", items: [ diff --git a/libs/schema/src/sections/index.ts b/libs/schema/src/sections/index.ts index 3655f8a4..556410c4 100644 --- a/libs/schema/src/sections/index.ts +++ b/libs/schema/src/sections/index.ts @@ -20,6 +20,7 @@ import { volunteerSchema } from "./volunteer"; export const sectionSchema = z.object({ name: z.string(), columns: z.number().min(1).max(5).default(1), + separateLinks: z.boolean().default(true), visible: z.boolean().default(true), }); @@ -98,6 +99,7 @@ export type CustomSectionGroup = z.infer; export const defaultSection: Section = { name: "", columns: 1, + separateLinks: true, visible: true, };