Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nisum-scorecard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Venkaiah Naidu Singamchetty
nisum-scorecard
Commits
b9e3d1af
Commit
b9e3d1af
authored
Mar 20, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activites slice made
parent
e6c980cf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
15 deletions
+32
-15
index.jsx
src/components/header/index.jsx
+29
-12
index.jsx
src/components/leftSidebar/index.jsx
+1
-1
index.jsx
src/components/modal/index.jsx
+1
-1
index.jsx
src/pages/dashboard/index.jsx
+1
-1
No files found.
src/components/header/index.jsx
View file @
b9e3d1af
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
useNavigate
,
Link
}
from
'react-router-dom'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
useNavigate
,
Link
}
from
'react-router-dom'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
clearStore
from
'../../utils/clearStore'
;
function
Header
({
isOpen
})
{
function
Header
({
isOpen
})
{
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
();
const
logoutRef
=
useRef
()
const
user
=
useSelector
((
state
)
=>
state
.
userDetails
.
user
);
const
[
open
,
setOpen
]
=
useState
(
false
)
...
...
@@ -13,25 +14,41 @@ function Header({isOpen}) {
navigate
(
'/'
);
clearStore
(
dispatch
)
}
useEffect
(()
=>
{
if
(
open
!==
false
)
setOpen
(
isOpen
)
useEffect
(()
=>
{
if
(
open
!==
false
)
setOpen
(
isOpen
)
},[
isOpen
])
},
[
isOpen
])
useEffect
(()
=>
{
// Function to disable the button when clicking anywhere on the document
const
handleClickOutside
=
(
event
)
=>
{
if
(
logoutRef
.
current
&&
!
logoutRef
.
current
.
contains
(
event
.
target
))
{
setOpen
(
false
);
}
};
document
.
addEventListener
(
'click'
,
handleClickOutside
);
return
()
=>
{
document
.
removeEventListener
(
'click'
,
handleClickOutside
);
};
},
[]);
return
(
<
div
className=
"flex items-center justify-between py-5 px-10"
onClick=
{
()
=>
setOpen
(
!
open
)
}
>
<
Link
to=
{
"/dashboard"
}
><
img
src=
"/logo.png"
/></
Link
>
<
div
className=
"flex items-center justify-between py-5 px-10"
>
<
Link
to=
{
"/dashboard"
}
><
img
src=
"/logo.png"
/></
Link
>
<
div
className=
"flex items-center relative"
>
<
button
className=
" -mt-1 text-2xl flex"
onClick=
{
()
=>
setOpen
(
!
open
)
}
>
<
button
ref=
{
logoutRef
}
className=
" -mt-1 text-2xl flex"
onClick=
{
()
=>
setOpen
(
!
open
)
}
>
<
img
src=
"/user.png"
width=
"35px"
height=
"35px"
className=
"mt-2 pr-2"
/>
<
div
className=
"flex flex-col"
>
<
p
className=
"text-lg font-semibold"
>
{
user
?.
empName
}
</
p
>
<
p
className=
"text-xs"
>
{
user
?.
designation
}
</
p
>
</
div
>
</
button
>
<
button
onClick=
{
handleLogout
}
className=
{
`${!open && "hidden"} absolute top-[40px] bg-white opacity-100 shadow-md px-5 py-1 bg-opacity-100 rounded border border-gray-400 right-0 hover:bg-blue-400 hover:text-white w-[-webkit-fill-available]`
}
style=
{
{
zIndex
:
1
}
}
>
Logout
<
button
onClick=
{
handleLogout
}
className=
{
`${!open && "hidden"} absolute top-[40px] bg-white opacity-100 shadow-md px-5 py-1 bg-opacity-100 rounded border border-gray-400 right-0 hover:bg-blue-400 hover:text-white w-[-webkit-fill-available]`
}
style=
{
{
zIndex
:
1
}
}
>
Logout
</
button
>
</
div
>
</
div
>
...
...
src/components/leftSidebar/index.jsx
View file @
b9e3d1af
...
...
@@ -43,7 +43,7 @@ function LeftSidebar() {
Reportees
</
p
>
<
input
placeholder=
"Search
Reportees
"
placeholder=
"Search"
type=
"text"
className=
"p-2 mi-2 border rounded w-[160px]"
value=
{
inputValue
}
...
...
src/components/modal/index.jsx
View file @
b9e3d1af
...
...
@@ -35,7 +35,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
const
handleScoreChange
=
(
value
)
=>
{
setActivityData
({
...
activityData
,
score
:
value
})
setActivityData
({
...
activityData
,
score
:
Number
(
value
)
})
}
const
handlePerformance
=
(
value
)
=>
{
...
...
src/pages/dashboard/index.jsx
View file @
b9e3d1af
...
...
@@ -114,7 +114,7 @@ function Dashboard() {
<
div
className=
"mb-2"
>
<
div
className=
"flex justify-end my-1 mr-2 items-center"
>
<
label
>
Search Employee:
</
label
>
<
input
placeholder=
"Enter
value
"
value=
{
inputValue
}
onChange=
{
handleChange
}
type=
"text"
className=
"p-1 px-2 border rounded ml-2"
/>
<
input
placeholder=
"Enter"
value=
{
inputValue
}
onChange=
{
handleChange
}
type=
"text"
className=
"p-1 px-2 border rounded ml-2"
/>
</
div
>
<
Table
headers=
{
headers
}
data=
{
reportees
}
loading=
{
loading
}
maxHeight=
{
88
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment