diff --git a/src/stores/slices/basic/interfaces/index.ts b/src/stores/slices/basic/interfaces/index.ts index 68653c3..e89f076 100644 --- a/src/stores/slices/basic/interfaces/index.ts +++ b/src/stores/slices/basic/interfaces/index.ts @@ -1,29 +1,29 @@ export type IProfiles = { - network: string; - username: string; - url: string; - color?: string; - template?: string[]; + network: string; + username: string; + url: string; + color?: string; + template?: string[]; }; type ILocation = { - city: string; + city: string; }; export interface BasicInfo { - profileImage?: string; - name: string; - label: string; - image: string; - intro: string; - email: string; - phone: string; - url: string; - location: ILocation; - profiles: IProfiles[]; + profileImage?: string; + name: string; + label: string; + image: string; + intro: string; + email: string; + phone: string; + url: string; + location: ILocation; + profiles: IProfiles[]; } export interface IBasicDetailsStore { - values: BasicInfo; - reset: (values: BasicInfo) => void; + values: BasicInfo; + reset: (values: BasicInfo) => void; } diff --git a/src/templates/Spectrum/index.tsx b/src/templates/Spectrum/index.tsx index 6650d7f..40d6f73 100644 --- a/src/templates/Spectrum/index.tsx +++ b/src/templates/Spectrum/index.tsx @@ -15,303 +15,305 @@ import { Education } from "@/stores/slices/education/interfaces"; import { selectSkills } from "@/stores/slices/skills/skillSlice"; const Spectrum = () => { - const basicInfo = useAppSelector(selectBasicInfo); - const experiences = useAppSelector(selectExperience); - const education = useAppSelector(selectEducation); - const skills = useAppSelector(selectSkills); + const basicInfo = useAppSelector(selectBasicInfo); + const experiences = useAppSelector(selectExperience); + const education = useAppSelector(selectEducation); + const skills = useAppSelector(selectSkills); - const filteredProfiles = basicInfo.profiles.filter( - (profile) => profile.network !== "Website" - ); + const filteredProfiles = basicInfo.profiles.filter( + (profile) => profile.network !== "Website", + ); - const getWebsiteProfile = basicInfo.profiles.filter( - (profile) => profile.network === "Website" - ); + const getWebsiteProfile = basicInfo.profiles.filter( + (profile) => profile.network === "Website", + ); - const frontendSkills = skills[0]?.frontendRelated; - const backendSkills = skills[0]?.backendRelated; + const frontendSkills = skills[0]?.frontendRelated; + const backendSkills = skills[0]?.backendRelated; - return ( -
-
-
-
- {basicInfo.profileImage && ( - profile - )} + return ( +
+
+
+
+ {basicInfo.profileImage && ( + profile + )} -

- {basicInfo.name} -

-

{basicInfo.label}

-

- {basicInfo.intro} -

-
- -
- {basicInfo.email && ( - } - label="Email" - value={basicInfo.email} - /> - )} - {getWebsiteProfile[0]?.username && ( - } - label="Website" - value={basicInfo.url} - username="salmandotweb.me" - link - /> - )} - {basicInfo.phone && ( - } - label="Phone" - value={basicInfo.phone} - /> - )} - {basicInfo.location.city && ( - } - label="Address" - value={basicInfo.location.city} - /> - )} -
- -
- {filteredProfiles.map((profile) => { - return ( - profile.username && ( - - ) - ); - })} -
- -
-
-
-

Experience

-
- {experiences?.map((experience) => { - return ( - <> - - {experience.id !== - experiences[experiences.length - 1].id && ( - - )} - - ); - })} -
-
-
-

Education

-
- {education?.map((education) => { - return ; - })} -
-
-
-

Skills

-
-
-
- frontend -

- Frontend -

-
-
- {frontendSkills?.map((skill) => { - return ; - })} -
-
-
-
- frontend -

- Backend -

-
-
- {backendSkills?.map((skill) => { - return ; - })} -
-
-
-
-
-

Tools

-
-
-
-
- ); +

+ {basicInfo.name} +

+

{basicInfo.label}

+

+ {basicInfo.intro} +

+
+ +
+ {basicInfo.email && ( + } + label="Email" + value={basicInfo.email} + /> + )} + {getWebsiteProfile[0]?.username && ( + } + label="Website" + value={basicInfo.url} + username="salmandotweb.me" + link + /> + )} + {basicInfo.phone && ( + } + label="Phone" + value={basicInfo.phone} + /> + )} + {basicInfo.location.city && ( + } + label="Address" + value={basicInfo.location.city} + /> + )} +
+ +
+ {filteredProfiles.map((profile) => { + return ( + profile.username && ( + + ) + ); + })} +
+ +
+
+
+

Experience

+
+ {experiences?.map((experience) => { + return ( + <> + + {experience.id !== + experiences[experiences.length - 1].id && ( + + )} + + ); + })} +
+
+
+

Education

+
+ {education?.map((education) => { + return ; + })} +
+
+
+

Skills

+
+
+
+ frontend +

+ Frontend +

+
+
+ {frontendSkills?.map((skill) => { + return ; + })} +
+
+
+
+ frontend +

+ Backend +

+
+
+ {backendSkills?.map((skill) => { + return ; + })} +
+
+
+
+
+

Tools

+
+
+
+
+ ); }; export default Spectrum; const Education = ({ - institution, - startYear, - endYear, - degree, - currentlyEnrolled, + institution, + startYear, + endYear, + degree, + currentlyEnrolled, }: Education) => { - return ( -
-
-

{degree}

-
-
-

{institution}

-

- {startYear} - {currentlyEnrolled ? "Present" : endYear} -

-
-
- ); + return ( +
+
+

{degree}

+
+
+

{institution}

+

+ {startYear} - {currentlyEnrolled ? "Present" : endYear} +

+
+
+ ); }; const Skill = ({ skill }: { skill: string }) => { - return ( -
-

- {skill} -

-
- ); + return ( +
+

+ {skill} +

+
+ ); }; const Experience = ({ - name, - companyLogo, - position, - joiningDate, - endDate, - currentlyWorkHere, - responsibilities, - location, + name, + companyLogo, + position, + joiningDate, + endDate, + currentlyWorkHere, + responsibilities, + location, }: IExperienceItem) => { - return ( -
-
-
-
-
-
-
-

- {formatDate(new Date(joiningDate))} -{" "} - {currentlyWorkHere - ? "Present" - : formatDate(new Date(endDate ?? new Date()))} -

- {location && ( - <> - -

- {location} -

- - )} -
-
- {companyLogo && ( - - )} -
-

{name}

-

- {position} -

-
-
-
-
- {responsibilities?.map((responsibility) => { - return ( -

- {responsibility.responsibility} -

- ); - })} -
-
- ); + return ( +
+
+
+
+
+
+
+

+ {formatDate(new Date(joiningDate))} -{" "} + {currentlyWorkHere + ? "Present" + : formatDate(new Date(endDate ?? new Date()))} +

+ {location && ( + <> + +

+ {location} +

+ + )} +
+
+ {companyLogo && ( + + )} +
+

{name}

+

+ {position} +

+
+
+
+
+ {responsibilities?.map((responsibility) => { + return ( +

+ {responsibility.responsibility} +

+ ); + })} +
+
+ ); }; const Info = ({ - icon, - image, - label, - value, - username, - link, + icon, + image, + label, + value, + username, + link, }: { - icon?: React.ReactNode; - image?: string; - label: string; - value: string; - username?: string; - link?: boolean; + icon?: React.ReactNode; + image?: string; + label: string; + value: string; + username?: string; + link?: boolean; }) => { - return ( -
-
-
{icon}
- {image && icon} -
+ return ( +
+
+
{icon}
+ {image && icon} +
-
-

{label}

- {!link ? ( -

{value}

- ) : ( - - {username} - - )} -
-
- ); +
+

{label}

+ {!link ? ( +

{value}

+ ) : ( + + {username} + + )} +
+
+ ); }; diff --git a/src/views/builder/components/Editor/components/BasicInfo/index.tsx b/src/views/builder/components/Editor/components/BasicInfo/index.tsx index b86f808..2ec24e0 100644 --- a/src/views/builder/components/Editor/components/BasicInfo/index.tsx +++ b/src/views/builder/components/Editor/components/BasicInfo/index.tsx @@ -5,243 +5,247 @@ import { Textarea } from "@/components/ui/textarea"; import { TEMPLATES } from "@/enums/availableTemplates"; import { useAppDispatch, useAppSelector } from "@/stores/hooks"; import { - selectBasicInfo, - updateBasicInfo, + selectBasicInfo, + updateBasicInfo, } from "@/stores/slices/basic/basicInfoSlice"; import { selectTemplate } from "@/stores/slices/templates/templateSlice"; const EditBasicInfo = () => { - const basicInfo = useAppSelector(selectBasicInfo); - const dispatch = useAppDispatch(); + const basicInfo = useAppSelector(selectBasicInfo); + const dispatch = useAppDispatch(); - const ActiveTemplate = useAppSelector(selectTemplate); + const ActiveTemplate = useAppSelector(selectTemplate); - return ( - <> - - - - About - - - Contact - - - Links - - - - {TEMPLATES.spectrum === ActiveTemplate.id && ( -
- - { - dispatch( - updateBasicInfo({ - ...basicInfo, - profileImage: e.target.value, - }) - ); - }} - /> -
- )} + return ( + <> + + + + About + + + Contact + + + Links + + + + {TEMPLATES.spectrum === ActiveTemplate.id && ( +
+ + { + dispatch( + updateBasicInfo({ + ...basicInfo, + profileImage: e.target.value, + }), + ); + }} + /> +
+ )} -
- - { - dispatch( - updateBasicInfo({ - ...basicInfo, - name: e.target.value, - }) - ); - }} - /> -
-
- - { - dispatch( - updateBasicInfo({ - ...basicInfo, - label: e.target.value, - }) - ); - }} - /> -
- {TEMPLATES.spectrum === ActiveTemplate.id && ( -
- -