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
699a1060
Commit
699a1060
authored
Apr 30, 2024
by
Shiva Komirishetti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table and toast changes
parent
2c444030
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
14 deletions
+28
-14
index.jsx
src/components/table/index.jsx
+14
-14
index.jsx
src/pages/layout/index.jsx
+14
-0
No files found.
src/components/table/index.jsx
View file @
699a1060
...
...
@@ -63,32 +63,32 @@ function Table({headers, data,loading, handleSorting }) {
<
table
className=
"w-full text-sm text-left rtl:text-right bg-transparent justify-center "
>
<
thead
className=
" uppercase bg-white font-extrabold"
>
<
tr
className=
"mb-2 border-2 border-black-200"
>
{
headers
?.
map
((
item
,
index
)
=>
(
<
th
key=
{
index
}
scope=
"col"
className=
{
`px-6 py-4 w-[${item.width}]`
}
>
{
item
.
renderHeader
?
item
.
renderHeader
(
item
.
title
)
:
item
.
isSorting
?
{
headers
?.
map
((
item
,
index
)
=>
(
!
item
?.
hide
&&
(
<
th
key=
{
index
}
scope=
"col"
className=
{
`px-6 py-4 w-[${item.width}]`
}
>
{
item
.
isSorting
?
<
span
className=
"flex items-center"
>
<
span
className=
"mr-4"
>
{
item
.
title
}
</
span
>
<
SortButton
selected=
{
item
.
id
===
sortKey
?
sortOrder
:
''
}
handleClick=
{
()
=>
handleSort
(
item
.
id
)
}
/>
</
span
>
:
<
span
>
{
item
.
title
}
</
span
>
}
</
th
>
</
th
>
)
))
}
</
tr
>
</
thead
>
{
(
data
?.
length
)?<
tbody
>
(
data
?.
length
&&
!
loading
)?<
tbody
>
{
data
?.
map
((
item
,
index
)
=>
(
<
tr
key=
{
item
.
id
}
className=
"bg-[#eef5ff] font-medium hover:bg-white "
>
{
headers
?.
map
(({
render
,
id
})
=>
(
<
td
className=
"px-6 py-2 capitalize"
>
{
render
?
render
(
item
[
id
])
:
item
[
id
]
===
""
?
"NA"
:
item
[
id
]
}
</
td
>
))
}
</
tr
>
<
tr
key=
{
item
.
id
}
className=
"bg-[#eef5ff] font-medium hover:bg-white "
>
{
headers
?.
map
(({
render
,
id
,
hide
})
=>
(
!
hide
&&
(
<
td
className=
"px-6 py-2 capitalize"
>
{
render
?
render
(
item
[
id
],
item
)
:
item
[
id
]
===
""
?
"NA"
:
item
[
id
]
}
</
td
>)
))
}
</
tr
>
))
}
</
tbody
>:
null
...
...
src/pages/layout/index.jsx
View file @
699a1060
...
...
@@ -2,8 +2,10 @@ import React, { useState } from 'react';
import
{
useLocation
}
from
"react-router-dom"
;
import
Header
from
'../../components/header'
;
import
Sidebar
from
'../../components/sidebar'
;
import
{
ToastContainer
}
from
'react-toastify'
;
import
LeftSidebar
from
'../../components/leftSidebar'
;
import
SetWindowSize
from
'../../utils/SetWindowSize'
;
import
'react-toastify/dist/ReactToastify.css'
;
function
Layout
({
children
})
{
const
location
=
useLocation
();
...
...
@@ -24,6 +26,18 @@ function Layout({children}) {
</
div
>
{
url
.
includes
(
'/viewreportee'
)
&&
<
LeftSidebar
/>
}
</
div
>
<
ToastContainer
position=
"bottom-center"
autoClose=
{
4000
}
hideProgressBar=
{
true
}
newestOnTop=
{
false
}
closeOnClick
rtl=
{
false
}
pauseOnFocusLoss
draggable
pauseOnHover
theme=
"light"
/>
</
div
>
)
}
...
...
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