disable buttons and leaderboard iterator

This commit is contained in:
Mateusz Tylka 2023-08-11 12:28:24 +02:00
parent aa1c1c3737
commit 6c4da8c181
6 changed files with 11 additions and 7 deletions

View File

@ -2,17 +2,17 @@ import React from 'react';
import { FlexRow, Svg } from '../../../../../utils/containers';
import theme from '../../../../../utils/theme';
const TableRowButtons = ({ buttons, i }) => {
const TableRowButtons = ({ buttons, i, active }) => {
return (
<FlexRow gap="12px">
{buttons.map((button, j) => {
return (
<Svg
key={`table-item-button-${i}-${j}`}
onClick={button.handler}
onClick={active ? button.handler : null}
src={button.icon}
backgroundColor={theme.colors.dark}
cursor="pointer"
backgroundColor={active ? theme.colors.dark : theme.colors.dark05}
cursor={active ? 'pointer' : 'auto'}
size="cover"
width="16px"
height="16px"

View File

@ -4,6 +4,7 @@ import TableRowTags from '../TableRowTags/TableRowTags';
import TableRowButtons from '../TableRowButtons/TableRowButtons';
import pensilIco from '../../../../../assets/pencil_ico.svg';
import deleteIco from '../../../../../assets/delete_ico.svg';
import KeyCloakService from '../../../../../services/KeyCloakService';
const TableRowFooter = ({ rowFooter, item, i, deleteItem, editItem }) => {
if (rowFooter) {
@ -15,6 +16,8 @@ const TableRowFooter = ({ rowFooter, item, i, deleteItem, editItem }) => {
{ icon: pensilIco, handler: () => editItem() },
{ icon: deleteIco, handler: () => deleteItem() },
]}
active={KeyCloakService.isLoggedIn()}
i={i}
/>
</FlexRow>
);

View File

@ -24,6 +24,7 @@ const TableRowItems = ({ orderedKeys, item, i }) => {
<Container className="mobile-table-header">{keyValue}</Container>
)}
{renderValue(keyValue)}
{keyValue === '#' && i + 1}
</td>
);
})}

View File

@ -110,7 +110,7 @@ const AllEntries = (props) => {
);
const n = (pageNr - 1) * (ELEMENTS_PER_PAGE * 2);
let elements = entries.slice(n, n + ELEMENTS_PER_PAGE * 2);
const elements = entries.slice(n, n + ELEMENTS_PER_PAGE * 2);
return (
<FlexColumn

View File

@ -1,6 +1,6 @@
const orderKeys = (elem) => {
if (elem) {
let result = ['id', 'submitter'];
let result = ['id', 'submitter', 'description'];
const elemKeys = Object.keys(elem);
const dev0keys = elemKeys
.filter((key) => key.split('.')[1] === 'dev-0')

View File

@ -1,6 +1,6 @@
const orderKeys = (elem) => {
if (elem) {
let result = ['id', 'submitter', 'description'];
let result = ['#', 'submitter', 'description'];
const elemKeys = Object.keys(elem);
const dev0keys = elemKeys
.filter((key) => key.split('.')[1] === 'dev-0')