From 31ba5f4ffa5ab66a48e556630888fe803781f070 Mon Sep 17 00:00:00 2001 From: aida-rodi Date: Thu, 17 Oct 2024 14:00:38 +0200 Subject: [PATCH] feature: added pencil icons to all components in the "My Profile" view --- .../studentProfile/StudentProfileContent.tsx | 25 ++-- .../MyProfileBootcampCard.tsx | 61 ++++++++ .../MyProfileCollaborationCard.tsx | 93 ++++++++++++ .../MyProfileLanguagesCard.tsx | 45 ++++++ .../MyProfileModalityCard.tsx | 46 ++++++ .../MyProfileProjectsCard.tsx | 113 ++++++++++++++ .../MyProfileStudentDetailCard.tsx | 140 ++++++++++++++++++ 7 files changed, 510 insertions(+), 13 deletions(-) create mode 100644 src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileBootcampCard.tsx create mode 100644 src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileCollaborationCard.tsx create mode 100644 src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileLanguagesCard.tsx create mode 100644 src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileModalityCard.tsx create mode 100644 src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileProjectsCard.tsx create mode 100644 src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileStudentDetailCard.tsx diff --git a/src/components/students/studentDetail/studentProfile/StudentProfileContent.tsx b/src/components/students/studentDetail/studentProfile/StudentProfileContent.tsx index 31614d4f..31225970 100644 --- a/src/components/students/studentDetail/studentProfile/StudentProfileContent.tsx +++ b/src/components/students/studentDetail/studentProfile/StudentProfileContent.tsx @@ -1,11 +1,11 @@ import React from 'react' -import ProjectsCard from '../cards/ProjectsCard' -import CollaborationCard from '../cards/CollaborationCard' -import BootcampCard from '../cards/BootcampCard' -import ModalityCard from '../cards/ModalityCard' -import StudentDataCard from '../cards/StudentDetailCard' -import LanguagesCard from '../cards/LanguagesCard' +import MyProfileStudentDetailCard from './studentProfileCards/MyProfileStudentDetailCard' +import MyProfileProjectsCard from './studentProfileCards/MyProfileProjectsCard' +import MyProfileCollaborationCard from './studentProfileCards/MyProfileCollaborationCard' +import MyProfileBootcampCard from './studentProfileCards/MyProfileBootcampCard' import AdditionalTrainingCard from '../cards/AdditionalTrainingCard' +import MyProfileLanguagesCard from './studentProfileCards/MyProfileLanguagesCard' +import MyProfileModalityCard from './studentProfileCards/MyProfileModalityCard' import { useStudentDetailHook } from '../../../../hooks/useStudentDetailHook' const StudentProfileContent: React.FC = () => { @@ -23,19 +23,18 @@ const StudentProfileContent: React.FC = () => {

Mi Perfil

- + {} - + - - - + + - + - + diff --git a/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileBootcampCard.tsx b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileBootcampCard.tsx new file mode 100644 index 00000000..64ee2d36 --- /dev/null +++ b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileBootcampCard.tsx @@ -0,0 +1,61 @@ +import React from 'react' +import { Pencil } from '../../../../../assets/svg' +import medal from '../../../../../assets/img/medal-dynamic-color.png' +import { useAppSelector } from '../../../../../hooks/ReduxHooks' +import LoadingSpiner from '../../../../atoms/LoadingSpiner' + +const MyProfileBootcampCard: React.FC = () => { + const { studentBootcamps } = useAppSelector((state) => state.ShowStudentReducer) + const { bootcampData, isErrorBootcamp, isLoadingBootcamp } = studentBootcamps + + return ( +
+
+

Datos del bootcamp

+ +
+ {isLoadingBootcamp && } + {isErrorBootcamp && ( + + )} + {!isLoadingBootcamp && + (bootcampData.length === 0 ? ( +
+

+ - Bootcamp no terminado - +

+
+ ) : ( + bootcampData.map((bootcamp) => ( +
+
+ Medal +
+

+ {bootcamp.name} +

+

+ Finalizado: {bootcamp.bootcamp_end_date} +

+
+
+
+ )) + ))} +
+ ) +} +export default MyProfileBootcampCard diff --git a/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileCollaborationCard.tsx b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileCollaborationCard.tsx new file mode 100644 index 00000000..ce67941f --- /dev/null +++ b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileCollaborationCard.tsx @@ -0,0 +1,93 @@ +import target from '../../../../../assets/img/target.png' +import folder from '../../../../../assets/img/folder.png' +import { Pencil } from '../../../../../assets/svg' +import { useAppSelector } from '../../../../../hooks/ReduxHooks' +import LoadingSpiner from '../../../../atoms/LoadingSpiner' + +const MyProfileCollaborationCard: React.FC = () => { + const { studentCollaborations } = useAppSelector((state) => state.ShowStudentReducer) + const {collaborationsData, isLoadingCollaborations, isErrorCollaborations} = studentCollaborations + const [resourcesCard, challengesCard] = collaborationsData + + return ( +
+
+

Colaboración

+ +
+
+ {isLoadingCollaborations && } + {isErrorCollaborations && ( + + )} + {!isLoadingCollaborations && ( + <> + {/* */} +
+
+ {resourcesCard === undefined ? ( +

+ -loading- +

+ ) : ( +

+ {resourcesCard.quantity} +

+ )} +

+ Recursos subidos +

+

+ ita-wiki +

+
+
+ folder +
+
+ + {/* */} +
+
+ {challengesCard === undefined ? ( +

+ -loading- +

+ ) : ( +

+ {challengesCard.quantity} +

+ )} +

+ Retos completados +

+

+ ita-challenges +

+
+
+ folder +
+
+ + )} +
+
+ ) +} + +export default MyProfileCollaborationCard diff --git a/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileLanguagesCard.tsx b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileLanguagesCard.tsx new file mode 100644 index 00000000..605d98a3 --- /dev/null +++ b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileLanguagesCard.tsx @@ -0,0 +1,45 @@ +import { Pencil } from '../../../../../assets/svg' +import { useAppSelector } from '../../../../../hooks/ReduxHooks' +import LoadingSpiner from '../../../../atoms/LoadingSpiner' + +const MyProfileLanguagesCard: React.FC = () => { + const { studentLanguages } = useAppSelector((state) => state.ShowStudentReducer) + const { languagesData, isLoadingLanguages, isErrorLanguages } = studentLanguages + + return ( +
+
+

Idiomas

+ +
+ {isLoadingLanguages && } + {isErrorLanguages && ( + + )} + {!isLoadingLanguages && ( +
+
+ {languagesData.map((language) => ( +
    +
  • + {language.name} - {language.level} +
  • +
+ ))} +
+
+ )} +
+ ) +} + +export default MyProfileLanguagesCard diff --git a/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileModalityCard.tsx b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileModalityCard.tsx new file mode 100644 index 00000000..048a36b3 --- /dev/null +++ b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileModalityCard.tsx @@ -0,0 +1,46 @@ +import { v4 as uuidv4 } from 'uuid' +import remoto from '../../../../../assets/svg/remoto.svg' +import { Pencil } from '../../../../../assets/svg' +import { useAppSelector } from '../../../../../hooks/ReduxHooks' +import LoadingSpiner from '../../../../atoms/LoadingSpiner' + +const MyProfileModalityCard: React.FC = () => { + const { + modality: modalityData, + isLoadingModality, + isErrorModality, + } = useAppSelector((state) => state.ShowStudentReducer.studentAdditionalModality) + + return ( +
+
+

Modalidad

+ +
+ {isLoadingModality && } + {isErrorModality && ( + + )} + {!isLoadingModality && ( +
+ {modalityData.map((modality) => ( +
+ remoto +

+ {modality.toString()} +

+
+ ))} +
+ )} +
+ ) +} + +export default MyProfileModalityCard diff --git a/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileProjectsCard.tsx b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileProjectsCard.tsx new file mode 100644 index 00000000..7af93b00 --- /dev/null +++ b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileProjectsCard.tsx @@ -0,0 +1,113 @@ +import { Github, Pencil, ArrowLeft, ArrowRight } from '../../../../../assets/svg' +import { ArrowRightProjects } from '../../../../../assets/img' +import { useAppSelector } from '../../../../../hooks/ReduxHooks' +import LoadingSpiner from '../../../../atoms/LoadingSpiner' +import { Carousel } from '../../../../atoms/Carousel' + +const MyProfileProjectsCard: React.FC = () => { + const { studentProjects } = useAppSelector((state) => state.ShowStudentReducer) + const { projectsData, isLoadingProjects, isErrorProjects } = studentProjects + + const { scrollLeft, scrollRight, carouselRef } = Carousel() + + return ( +
+
+

Proyectos

+ {projectsData && ( + + )} +
+ + +
+
+ {isLoadingProjects && } + {isErrorProjects && ( + + )} + {projectsData && ( +
+ {projectsData.map((project) => ( +
+
+
+

+ {project.name.slice(0, 15)} +

+ + github link + +
+ +
+

+ {project.company_name} +

+
+
+ {project.tags + .slice(0, 2) + .map((tag, index) => ( + + {tag.name} + {index !== 1 && ' · '} + + ))} +
+ + right arrow button + +
+
+ ))} +
+ )} +
+ ) +} + +export default MyProfileProjectsCard diff --git a/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileStudentDetailCard.tsx b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileStudentDetailCard.tsx new file mode 100644 index 00000000..2c5927f6 --- /dev/null +++ b/src/components/students/studentDetail/studentProfile/studentProfileCards/MyProfileStudentDetailCard.tsx @@ -0,0 +1,140 @@ +import { useState } from 'react' +import { Github, Linkedin, Pencil } from '../../../../../assets/svg' +import { Stud1 as ProfilePicture } from '../../../../../assets/img' +import { ITag } from '../../../../../interfaces/interfaces' +import { useAppSelector } from '../../../../../hooks/ReduxHooks' +import LoadingSpiner from '../../../../atoms/LoadingSpiner' + +const MyProfileStudentDetailCard: React.FC = () => { + const [showFullDescription, setShowFullDescription] = useState(false) + + const toggleDescription = () => { + setShowFullDescription(!showFullDescription) + } + const { aboutData, isLoadingAboutData, isErrorAboutData } = useAppSelector( + (state) => state.ShowStudentReducer.studentDetails, + ) + return ( +
+ {isLoadingAboutData && } + {isErrorAboutData && } + {!isLoadingAboutData && ( +
+
+ Profile +
+
+
+
+

+ {aboutData.fullname} +

+ +
+ +

+ {aboutData.resume.subtitle} +

+
+ +
+
+
+
+
+

About

+
+

+ {showFullDescription + ? aboutData && aboutData.resume.about + : `${aboutData.resume.about + .split(' ') + .slice(0, 15) + .join(' ')}...`} + {!showFullDescription && ( + + )} +

+ {showFullDescription && ( +

+ +

+ )} +
+
+ +
+
    + {aboutData && + aboutData.tags.map((tag: ITag) => ( +
  • + {tag.name} +
  • + ))} +
+ +
+
+
+ )} +
+ ) +} + +export default MyProfileStudentDetailCard