Skip to content

Commit

Permalink
remove extra loader and add success notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu1902 committed Sep 3, 2023
1 parent e21652b commit 77c103e
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions src/Components/Users/SkillsSlideOver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export default ({ show, setShow, username }: IProps) => {
Notification.Error({
msg: "Error while adding skill",
});
} else {
Notification.Success({
msg: "Skill added successfully",
});
}
setSelectedSkill(null);
setIsLoading(false);
Expand Down Expand Up @@ -110,36 +114,33 @@ export default ({ show, setShow, username }: IProps) => {
>
<div>
<div className="col-span-full sm:col-span-3 sm:col-start-2">
<div className="tooltip flex items-center gap-2">
<SkillSelect
multiple={false}
name="skill"
disabled={!authorizeForAddSkill}
showAll={true}
showNOptions={Infinity}
selected={selectedSkill}
setSelected={setSelectedSkill}
errors=""
username={username}
/>
{isLoading ? (
<CircularProgress className="h-5 w-5" />
) : (
{!isLoading && (
<div className="tooltip flex items-center gap-2">
<SkillSelect
multiple={false}
name="skill"
disabled={!authorizeForAddSkill}
showAll={true}
showNOptions={Infinity}
selected={selectedSkill}
setSelected={setSelectedSkill}
errors=""
username={username}
/>
<ButtonV2
disabled={!authorizeForAddSkill}
onClick={() => addSkill(username, selectedSkill)}
className="w-6rem"
>
{t("add")}
</ButtonV2>
)}
{!authorizeForAddSkill && (
<span className="tooltip-text tooltip-bottom -translate-x-24 translate-y-2">
{t("contact_your_admin_to_add_skills")}
</span>
)}
</div>
{/* While loading skills, we display an additional circular progress to show we are fetching the information*/}
{!authorizeForAddSkill && (
<span className="tooltip-text tooltip-bottom -translate-x-24 translate-y-2">
{t("contact_your_admin_to_add_skills")}
</span>
)}
</div>
)}
{isLoading ? (
<div className="mt-4 flex justify-center">
<CircularProgress />
Expand Down

0 comments on commit 77c103e

Please sign in to comment.