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
4a050bfa
Commit
4a050bfa
authored
Mar 20, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'apiserver' into 'master'
activites slice made See merge request
!69
parents
021d1107
b9e3d1af
Changes
4
Show 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 @
4a050bfa
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
useNavigate
,
Link
}
from
'react-router-dom'
;
import
{
useNavigate
,
Link
}
from
'react-router-dom'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
clearStore
from
'../../utils/clearStore'
;
import
clearStore
from
'../../utils/clearStore'
;
function
Header
({
isOpen
})
{
function
Header
({
isOpen
})
{
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
logoutRef
=
useRef
()
const
user
=
useSelector
((
state
)
=>
state
.
userDetails
.
user
);
const
user
=
useSelector
((
state
)
=>
state
.
userDetails
.
user
);
const
[
open
,
setOpen
]
=
useState
(
false
)
const
[
open
,
setOpen
]
=
useState
(
false
)
...
@@ -13,24 +14,40 @@ function Header({isOpen}) {
...
@@ -13,24 +14,40 @@ function Header({isOpen}) {
navigate
(
'/'
);
navigate
(
'/'
);
clearStore
(
dispatch
)
clearStore
(
dispatch
)
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
open
!==
false
)
if
(
open
!==
false
)
setOpen
(
isOpen
)
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
(
return
(
<
div
className=
"flex items-center justify-between py-5 px-10"
onClick=
{
()
=>
setOpen
(
!
open
)
}
>
<
div
className=
"flex items-center justify-between py-5 px-10"
>
<
Link
to=
{
"/dashboard"
}
><
img
src=
"/logo.png"
/></
Link
>
<
Link
to=
{
"/dashboard"
}
><
img
src=
"/logo.png"
/></
Link
>
<
div
className=
"flex items-center relative"
>
<
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"
/>
<
img
src=
"/user.png"
width=
"35px"
height=
"35px"
className=
"mt-2 pr-2"
/>
<
div
className=
"flex flex-col"
>
<
div
className=
"flex flex-col"
>
<
p
className=
"text-lg font-semibold"
>
{
user
?.
empName
}
</
p
>
<
p
className=
"text-lg font-semibold"
>
{
user
?.
empName
}
</
p
>
<
p
className=
"text-xs"
>
{
user
?.
designation
}
</
p
>
<
p
className=
"text-xs"
>
{
user
?.
designation
}
</
p
>
</
div
>
</
div
>
</
button
>
</
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
}
}
>
<
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
Logout
</
button
>
</
button
>
</
div
>
</
div
>
...
...
src/components/leftSidebar/index.jsx
View file @
4a050bfa
...
@@ -43,7 +43,7 @@ function LeftSidebar() {
...
@@ -43,7 +43,7 @@ function LeftSidebar() {
Reportees
Reportees
</
p
>
</
p
>
<
input
<
input
placeholder=
"Search
Reportees
"
placeholder=
"Search"
type=
"text"
type=
"text"
className=
"p-2 mi-2 border rounded w-[160px]"
className=
"p-2 mi-2 border rounded w-[160px]"
value=
{
inputValue
}
value=
{
inputValue
}
...
...
src/components/modal/index.jsx
View file @
4a050bfa
...
@@ -35,7 +35,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
...
@@ -35,7 +35,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
const
handleScoreChange
=
(
value
)
=>
{
const
handleScoreChange
=
(
value
)
=>
{
setActivityData
({
...
activityData
,
score
:
value
})
setActivityData
({
...
activityData
,
score
:
Number
(
value
)
})
}
}
const
handlePerformance
=
(
value
)
=>
{
const
handlePerformance
=
(
value
)
=>
{
...
...
src/pages/dashboard/index.jsx
View file @
4a050bfa
...
@@ -114,7 +114,7 @@ function Dashboard() {
...
@@ -114,7 +114,7 @@ function Dashboard() {
<
div
className=
"mb-2"
>
<
div
className=
"mb-2"
>
<
div
className=
"flex justify-end my-1 mr-2 items-center"
>
<
div
className=
"flex justify-end my-1 mr-2 items-center"
>
<
label
>
Search Employee:
</
label
>
<
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
>
</
div
>
<
Table
headers=
{
headers
}
data=
{
reportees
}
loading=
{
loading
}
maxHeight=
{
88
}
/>
<
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