Skip to content

Commit

Permalink
fix(nui): Properly space all main content elements
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWasTakenn committed Jan 11, 2022
1 parent 103ae6d commit cee8da3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ui/src/components/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
import { useEffect, useState, useMemo } from 'react';
import { fetchNui } from '../utils/fetchNui';
import { useNuiEvent } from '../hooks/useNuiEvent';
import { Table, Thead, Tbody, Tr, Th, Td, chakra, Flex, IconButton, Text, Spinner, Center } from '@chakra-ui/react';
import { Table, Thead, Tbody, Tr, Th, Td, chakra, Flex, IconButton, Text, Spinner } from '@chakra-ui/react';
import {
TriangleDownIcon,
TriangleUpIcon,
Expand All @@ -12,6 +12,7 @@ import {
ChevronRightIcon,
} from '@chakra-ui/icons';
import { useTable, useSortBy, Column, usePagination, useFlexLayout } from 'react-table';
import { debugData } from '../utils/debugData';

interface QueryData {
date: number;
Expand Down Expand Up @@ -99,7 +100,7 @@ const Resource: React.FC = () => {
});

return (
<>
<Flex direction="column" justifyContent="space-between" alignItems="center" h="100%">
<Table {...getTableProps()} size="sm">
<Thead>
{headerGroups.map((header): any => (
Expand Down Expand Up @@ -127,7 +128,7 @@ const Resource: React.FC = () => {
))}
</Thead>
<Tbody {...getTableBodyProps()}>
{isLoaded ? (
{isLoaded && (
<>
{page.map((row) => {
prepareRow(row);
Expand All @@ -150,10 +151,12 @@ const Resource: React.FC = () => {
);
})}
</>
) : <Center height={32}><Spinner /></Center>}
)}
</Tbody>
</Table>

{!isLoaded && <Spinner />}

<Flex mt={3} justifyContent="center " alignItems="center" p="1.2vh">
<Flex>
<IconButton
Expand Down Expand Up @@ -193,7 +196,7 @@ const Resource: React.FC = () => {
/>
</Flex>
</Flex>
</>
</Flex>
);
};

Expand Down

0 comments on commit cee8da3

Please sign in to comment.