Compare commits
No commits in common. "db918ba7c7a4d632a33e5387455d601fb56c6423" and "e4969938c321ba56ecf73218d90226bb46f44401" have entirely different histories.
db918ba7c7
...
e4969938c3
@ -3,19 +3,13 @@ import Sidebar from '../Sidebar';
|
|||||||
import Orders from '../Orders';
|
import Orders from '../Orders';
|
||||||
import Masters from '../Masters';
|
import Masters from '../Masters';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
|
||||||
|
|
||||||
const LayoutArm = () => (
|
const LayoutArm = ({ currentPage, onSelectPage }) => (
|
||||||
<Flex h='100vh'>
|
<Flex h='100vh'>
|
||||||
<Sidebar />
|
<Sidebar onSelectPage={onSelectPage} />
|
||||||
<Box flex='1' bg='gray.50'>
|
<Box flex='1' bg='gray.50'>
|
||||||
<Routes>
|
{currentPage === 'orders' && <Orders />}
|
||||||
<Route>
|
{currentPage === 'masters' && <Masters />}
|
||||||
<Route index element={<Navigate to='orders' replace />} />
|
|
||||||
<Route path='orders' element={<Orders />} />
|
|
||||||
<Route path='masters' element={<Masters />} />
|
|
||||||
</Route>
|
|
||||||
</Routes>
|
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
@ -2,9 +2,7 @@ import { Box, Button, Heading, VStack } from '@chakra-ui/react';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Divider } from '@chakra-ui/react';
|
import { Divider } from '@chakra-ui/react';
|
||||||
import i18next from 'i18next';
|
import i18next from 'i18next';
|
||||||
import { Link } from 'react-router-dom';
|
const Sidebar = ({ onSelectPage }) => (
|
||||||
|
|
||||||
const Sidebar = () => (
|
|
||||||
<Box
|
<Box
|
||||||
borderRight='1px solid black'
|
borderRight='1px solid black'
|
||||||
bg='gray.50'
|
bg='gray.50'
|
||||||
@ -20,8 +18,7 @@ const Sidebar = () => (
|
|||||||
<VStack align='start' spacing='4'>
|
<VStack align='start' spacing='4'>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Button
|
<Button
|
||||||
as={Link}
|
onClick={() => onSelectPage('orders')}
|
||||||
to='orders'
|
|
||||||
w='100%'
|
w='100%'
|
||||||
colorScheme='green'
|
colorScheme='green'
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
@ -30,8 +27,7 @@ const Sidebar = () => (
|
|||||||
</Button>
|
</Button>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Button
|
<Button
|
||||||
as={Link}
|
onClick={() => onSelectPage('masters')}
|
||||||
to='masters'
|
|
||||||
w='100%'
|
w='100%'
|
||||||
colorScheme='green'
|
colorScheme='green'
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
|
@ -2,7 +2,9 @@ import React, { useState } from 'react';
|
|||||||
import LayoutArm from '../../components/LayoutArm';
|
import LayoutArm from '../../components/LayoutArm';
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <LayoutArm />;
|
const [currentPage, setCurrentPage] = useState('orders');
|
||||||
|
|
||||||
|
return <LayoutArm currentPage={currentPage} onSelectPage={setCurrentPage} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
@ -16,10 +16,9 @@ const Routers = () => {
|
|||||||
<Route path='order-form' element={<OrderForm />} />
|
<Route path='order-form' element={<OrderForm />} />
|
||||||
<Route path='order-view' element={<OrderView />} />
|
<Route path='order-view' element={<OrderView />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path='/dry-wash/arm/*' element={<Arm />}></Route>
|
<Route path='/dry-wash/arm' element={<Arm />}></Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user