From 2c15418011befd4b04274428f82217160f6bb057 Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 2 Jan 2022 00:54:39 +0100 Subject: [PATCH] refactor(nui): Layout improvements --- ui/src/components/MainContent.tsx | 4 ++-- ui/src/components/NavBars/LeftBar.tsx | 6 ++++-- ui/src/components/NavBars/RightBar.tsx | 16 +++++++++------- ui/src/components/Resource.tsx | 8 +++++++- ui/src/index.css | 13 +++++++++++++ 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/ui/src/components/MainContent.tsx b/ui/src/components/MainContent.tsx index fd0a18c..d8721ef 100644 --- a/ui/src/components/MainContent.tsx +++ b/ui/src/components/MainContent.tsx @@ -4,8 +4,8 @@ import { Box, Center } from '@chakra-ui/react'; const MainContent: React.FC = ({ children }) => { return ( <> -
- +
+ {children}
diff --git a/ui/src/components/NavBars/LeftBar.tsx b/ui/src/components/NavBars/LeftBar.tsx index 4e05f4a..391cb9c 100644 --- a/ui/src/components/NavBars/LeftBar.tsx +++ b/ui/src/components/NavBars/LeftBar.tsx @@ -29,11 +29,13 @@ const LeftBar: React.FC = () => { }); return ( - + {initData.resources.map((resource, index) => ( - {resource} + + {resource} + ))} diff --git a/ui/src/components/NavBars/RightBar.tsx b/ui/src/components/NavBars/RightBar.tsx index 6fcd9cb..d5a43ee 100644 --- a/ui/src/components/NavBars/RightBar.tsx +++ b/ui/src/components/NavBars/RightBar.tsx @@ -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 ( - - - Number of slow queries: 3 - Most active resource: essentialmode - Total number of queries: 732 - + +
+ + Number of slow queries: 3 + Most active resource: essentialmode + Total number of queries: 732 + +
); }; diff --git a/ui/src/components/Resource.tsx b/ui/src/components/Resource.tsx index 9fd78b6..8402b29 100644 --- a/ui/src/components/Resource.tsx +++ b/ui/src/components/Resource.tsx @@ -72,7 +72,12 @@ const Resource: React.FC = () => { {headerGroups.map((header): any => ( {header.headers.map((column) => ( - + {column.render('Header')} {column.isSorted ? ( @@ -100,6 +105,7 @@ const Resource: React.FC = () => { wordBreak="break-word" textOverflow="ellipsis" overflow="hidden" + borderBottomColor="#313C4A" > {cell.render('Cell')} diff --git a/ui/src/index.css b/ui/src/index.css index 70390ce..92281a1 100644 --- a/ui/src/index.css +++ b/ui/src/index.css @@ -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; +}