mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
refactor(nui): Improve design scalability
This commit is contained in:
1 parent
4e027c18fe
commit
1e00e9fe02
6 files changed
+20
-20
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Center, Box } from '@chakra-ui/react';
|
||||
import { Flex, Box } from '@chakra-ui/react';
|
||||
import { debugData } from '../utils/debugData';
|
||||
import TopBar from './NavBars/TopBar';
|
||||
import LeftBar from './NavBars/LeftBar';
|
||||
@@ -31,12 +31,12 @@ const App: React.FC = () => {
|
||||
useNuiEvent('openUI', () => navigate('/'));
|
||||
|
||||
return (
|
||||
<Center w="100%" h="100%">
|
||||
<Flex w="100%" h="100%" alignItems="center" justifyContent="center">
|
||||
<Box
|
||||
width="60%"
|
||||
height="50%"
|
||||
width="6xl"
|
||||
height="lg"
|
||||
backgroundColor="#191E26"
|
||||
borderRadius="1vh"
|
||||
borderRadius="lg"
|
||||
color="white"
|
||||
fontFamily="Poppins"
|
||||
userSelect="none"
|
||||
@@ -51,7 +51,7 @@ const App: React.FC = () => {
|
||||
</Routes>
|
||||
</MainContent>
|
||||
</Box>
|
||||
</Center>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -3,13 +3,11 @@ import { Box, Center } from '@chakra-ui/react';
|
||||
|
||||
const MainContent: React.FC = ({ children }) => {
|
||||
return (
|
||||
<>
|
||||
<Center h="95%" alignItems="stretch">
|
||||
<Box h="100%" w="50%" backgroundColor="#1B2129" flex="1" overflowY="scroll">
|
||||
{children}
|
||||
</Box>
|
||||
</Center>
|
||||
</>
|
||||
<Center>
|
||||
<Box h="30.3rem" w="50%" backgroundColor="#1B2129" flex="1">
|
||||
{children}
|
||||
</Box>
|
||||
</Center>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const LeftBar: React.FC = () => {
|
||||
});
|
||||
|
||||
return (
|
||||
<Box p="1.2vh" fontSize="1.5vh" float="left" w="13%" height="90%" overflowY="scroll">
|
||||
<Box pl={3} pr={3} pb={3} pt={2} fontSize="md" float="left" w={150} height="90%" overflowY="scroll">
|
||||
<VStack align="left">
|
||||
{initData.resources.map((resource, index) => (
|
||||
<Box isTruncated key={`${resource}-${index}`}>
|
||||
@@ -28,7 +28,9 @@ const LeftBar: React.FC = () => {
|
||||
color: state.isActive ? 'white' : 'grey',
|
||||
})}
|
||||
>
|
||||
<Box _hover={{ color: 'white' }}>{resource}</Box>
|
||||
<Box _hover={{ color: 'white' }} isTruncated>
|
||||
{resource}
|
||||
</Box>
|
||||
</NavLink>
|
||||
</Box>
|
||||
))}
|
||||
|
||||
@@ -20,7 +20,7 @@ const RightBar: React.FC = () => {
|
||||
});
|
||||
|
||||
return (
|
||||
<Box float="right" w="20%" h="100%" p="1.2vh">
|
||||
<Box float="right" w="3xs" h="100%" p={3}>
|
||||
<Center h="100%">
|
||||
<Flex direction="column" h="100%">
|
||||
<Box>
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Box, Text } from '@chakra-ui/react';
|
||||
|
||||
const TopBar: React.FC = () => {
|
||||
return (
|
||||
<Box w="100%" h="5%">
|
||||
<Text paddingLeft="1.2vh" fontSize="2vh">
|
||||
<Box w="full" h="4xs">
|
||||
<Text paddingLeft={3} fontSize="lg">
|
||||
Resources
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
@@ -105,7 +105,7 @@ const Resource: React.FC = () => {
|
||||
});
|
||||
|
||||
return (
|
||||
<Flex direction="column" justifyContent="space-between" alignItems="center" h="100%">
|
||||
<Flex direction="column" justifyContent="space-between" alignItems="center" h="full">
|
||||
<Table {...getTableProps()} size="sm">
|
||||
<Thead>
|
||||
{headerGroups.map((header): any => (
|
||||
@@ -164,7 +164,7 @@ const Resource: React.FC = () => {
|
||||
|
||||
{!isLoaded && <Spinner />}
|
||||
|
||||
<Flex mt={3} justifyContent="center " alignItems="center" p="1.2vh">
|
||||
<Flex justifyContent="center" alignItems="center" p={3}>
|
||||
<Flex>
|
||||
<IconButton
|
||||
icon={<ArrowLeftIcon h={3} w={3} color="black" />}
|
||||
|
||||
Reference in new issue
Block a user