refactor(nui): Layout improvements

This commit is contained in:
Luke committed 2022-01-02 00:54:39 +01:00
1 parent ed03361f61
commit 2c15418011
5 files changed
+35 -12

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ import { Box, Center } from '@chakra-ui/react';
const MainContent: React.FC = ({ children }) => {
return (
<>
<Center h="95%">
<Box h="100%" w="95%" backgroundColor="#1B2129">
<Center h="95%" alignItems="stretch">
<Box h="100%" w="50%" backgroundColor="#1B2129" flex="1">
{children}
</Box>
</Center>
+4 -2
View File
@@ -29,11 +29,13 @@ const LeftBar: React.FC = () => {
});
return (
<Box p="1.2vh" fontSize="1.5vh" float="left" maxWidth="13vh">
<Box p="1.2vh" fontSize="1.5vh" float="left" w="10%" height="55vh" overflowY="scroll">
<VStack align="left">
{initData.resources.map((resource, index) => (
<Link to={resource} key={`${resource}-${index}`}>
<Box _hover={{ transform: 'scale(1.1)' }}>{resource}</Box>
<Box _hover={{ transform: 'scale(1.1)', color: 'white' }} color="grey">
{resource}
</Box>
</Link>
))}
</VStack>
+9 -7
View File
@@ -1,14 +1,16 @@
import React from 'react';
import { Box, VStack } from '@chakra-ui/react';
import { Box, VStack, Center } from '@chakra-ui/react';
const RightBar: React.FC = () => {
return (
<Box float="right" w="20%" h="max">
<VStack align="left">
<Box>Number of slow queries: 3</Box>
<Box>Most active resource: essentialmode</Box>
<Box>Total number of queries: 732</Box>
</VStack>
<Box float="right" w="20%" h="max" p="1.2vh">
<Center>
<VStack align="left">
<Box>Number of slow queries: 3</Box>
<Box>Most active resource: essentialmode</Box>
<Box>Total number of queries: 732</Box>
</VStack>
</Center>
</Box>
);
};
+7 -1
View File
@@ -72,7 +72,12 @@ const Resource: React.FC = () => {
{headerGroups.map((header): any => (
<Tr {...header.getHeaderGroupProps()}>
{header.headers.map((column) => (
<Th {...column.getHeaderProps(column.getSortByToggleProps())} color="white" fontFamily="Poppins">
<Th
{...column.getHeaderProps(column.getSortByToggleProps())}
color="white"
fontFamily="Poppins"
borderBottomColor="#313C4A"
>
{column.render('Header')}
<chakra.span pl="4">
{column.isSorted ? (
@@ -100,6 +105,7 @@ const Resource: React.FC = () => {
wordBreak="break-word"
textOverflow="ellipsis"
overflow="hidden"
borderBottomColor="#313C4A"
>
{cell.render('Cell')}
</Td>
+13
View File
@@ -17,3 +17,16 @@ body {
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}
::-webkit-scrollbar {
width: 2px;
border-radius: 1vh;
background-color: transparent;
padding: 0;
margin: 0;
}
::-webkit-scrollbar-thumb {
background: grey;
border-radius: 1vh;
}