Skip to content

Commit 9ba4d68

Browse files
committed
Merge branch 'master' into ailys/G7T5-197
2 parents 8b44edb + 099a2d3 commit 9ba4d68

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

app/src/components/job/JobTile.jsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,15 @@ export default function JobTile({ jobId, jobName, jobDesc, skills, isActive, set
6161
</div>
6262
<div className='flex items-center mt-5 md:mt-0 justify-between'>
6363
<div className='flex-col'>
64-
{skills.length >= 1 && (
64+
{currentUserType === "STAFF" && skills.length >= 1 && (
6565
<CreateLearningJourneyButton handleCreateLJButtonClick={handleCreateLJButtonClick} />
6666
)}
67-
<div className='flex'>
68-
{currentUserType === "HR" && (
67+
{currentUserType === "HR" && (
68+
<div className='flex md:flex-col'>
6969
<CreateEditJobButton handleEditJobButtonClick={handleEditJobButtonClick} />
70-
)}
71-
{currentUserType === "HR" && isActive ? (
72-
<CreateDeleteJobButton showPopUp={showPopUp} />
73-
) : null}
74-
</div>
70+
{isActive ? <CreateDeleteJobButton showPopUp={showPopUp}/> : null}
71+
</div>
72+
)}
7573
</div>
7674
<JobTileButton isDetailsOpen={isDetailsOpen} setIsDetailsOpen={setIsDetailsOpen} />
7775
{currentUserType === "HR" && (
@@ -109,13 +107,13 @@ function CreateEditJobButton({ handleEditJobButtonClick }) {
109107
function CreateDeleteJobButton({ showPopUp }) {
110108
return (
111109
<button
112-
type='button'
113-
className='w-full flex items-center justify-center ml-auto text-white bg-secondary hover:bg-primary focus:ring-2 focus:ring-gray-300 rounded-lg text-sm px-5 py-2.5 text-center m-1'
114-
onClick={showPopUp}
115-
>
116-
<TrashIcon className='mr-2 h-5 w-5' aria-hidden='true' />
117-
<span>Deactivate</span>
118-
</button>
110+
type='button'
111+
className='w-full flex items-center justify-center ml-auto text-white bg-accent2 hover:bg-accent3 focus:ring-2 focus:ring-gray-300 rounded-lg text-sm px-5 py-2.5 text-center m-1'
112+
onClick={showPopUp}
113+
>
114+
<TrashIcon className='mr-2 h-5 w-5' aria-hidden='true' />
115+
<span>Deactivate</span>
116+
</button>
119117
);
120118
}
121119

app/src/components/job/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ function Job() {
1414
<HRJob/>
1515
</>
1616
);
17-
case "STAFF":
1817
case "MANAGER":
18+
return <p>You are logged in as MANAGER so you see no Jobs</p>;
19+
case "STAFF":
1920
default:
2021
// temporary addition for development, should not render anything without permission
2122
return (

app/src/components/skill/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ function Skill() {
1414
<HRSkill />
1515
</>
1616
);
17-
case "STAFF":
1817
case "MANAGER":
18+
return <p>You are logged in as MANAGER so you see no skills</p>;
19+
case "STAFF":
1920
default:
2021
return (
2122
<>

app/src/layout/Navbar.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline";
66
import { PlusIcon } from "@heroicons/react/20/solid";
77
import { toast } from "react-toastify";
88

9+
import { useUserContext } from "src/contexts/UserContext";
910
import Login from "./Login";
1011

1112
export default function Navbar() {
13+
const { currentUserType } = useUserContext();
14+
1215
const [pageNavigation, setPageNavigation] = useState([
1316
{ name: "Learning Journeys", href: "/learning-journeys" },
1417
{ name: "Skills", href: "/skills" },
@@ -39,7 +42,7 @@ export default function Navbar() {
3942
<>
4043
<div className='flex h-16 justify-between mx-auto max-w-7xl px-4 sm:px-6 lg:px-8'>
4144
<RoutingItems open={open} pageNavigation={pageNavigation} />
42-
<CreateLJButton />
45+
{currentUserType === "STAFF" && <CreateLJButton />}
4346
<LoginButton />
4447
</div>
4548
<Disclosure.Panel className='md:hidden'>

0 commit comments

Comments
 (0)