From d6884693a3165cef0ed755c7838d79d51729cea4 Mon Sep 17 00:00:00 2001 From: Julio Verne <55258516+julio-ufpb@users.noreply.github.com> Date: Sun, 31 Dec 2023 11:42:11 -0300 Subject: [PATCH] change: prevent render competence add duplicate --- .../CompetencesSettings/CompetencesSettings.tsx | 14 +++++--------- .../Competences/Ability/CurriculumAbility.tsx | 6 ------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/pages/Profile/CompetencesSettings/CompetencesSettings.tsx b/src/pages/Profile/CompetencesSettings/CompetencesSettings.tsx index e8a63352..1bf31953 100644 --- a/src/pages/Profile/CompetencesSettings/CompetencesSettings.tsx +++ b/src/pages/Profile/CompetencesSettings/CompetencesSettings.tsx @@ -3,8 +3,6 @@ import { useContext, useState } from "react"; import { ProfileContext } from "@/pages/Profile"; import { Level, LevelToLabel } from "@/types/Competence"; import { UniversimeApi } from "@/services/UniversimeApi"; -import { deactivateButtonWhile, setStateAsValue } from "@/utils/tsxUtils"; -import * as SwalUtils from "@/utils/sweetalertUtils"; import { FormInputs, UniversiForm } from "@/components/UniversiForm/UniversiForm"; import './CompetencesSettings.less' @@ -13,12 +11,8 @@ export function CompetencesSettings() { const profileContext = useContext(ProfileContext) const editCompetence = profileContext?.editCompetence ?? null; - const [competenceTypeId, setCompetenceTypeId] = useState(editCompetence?.competenceType.id ?? ""); - const [competenceLevel, setCompetenceLevel] = useState(editCompetence?.level ?? ""); - const [description, setDescription] = useState(editCompetence?.description ?? ""); - return ( - profileContext === null ? null : + profileContext && Nenhuma competĂȘncia cadastrada.

} - - { profileContext.editCompetence !== undefined && - - - - } ); }