-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
2,616 additions
and
151 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
import React from 'react'; | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import Box from '@mui/material/Box'; | ||
|
||
function App() { | ||
import OrdersTable from './components/OrdersTable/OrdersTable'; | ||
import OrdersPagination from './components/OrdersPagination/OrdersPagination'; | ||
import OrdersModal from './components/OrdersModal/OrdersModal'; | ||
|
||
const style = { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
width: '1200px', | ||
height: '100vh', | ||
margin: '0 auto', | ||
padding: '0 3px', | ||
}; | ||
|
||
const App: React.FC = () => { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
<Box sx={style}> | ||
<OrdersModal /> | ||
<OrdersTable /> | ||
<OrdersPagination /> | ||
</Box> | ||
); | ||
} | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from "react"; | ||
import Box from "@mui/material/Box"; | ||
import Modal from "@mui/material/Modal"; | ||
|
||
import { useAppDispatch, useAppSelector } from "../../hooks/customHooks"; | ||
import { setIsModal } from "../../store/reducers/modalSlice"; | ||
|
||
const OrdersModal: React.FC = () => { | ||
const { isModal } = useAppSelector((state) => state.modalReducer); | ||
const dispatch = useAppDispatch(); | ||
const handleClose = () => dispatch(setIsModal()); | ||
|
||
return ( | ||
<div> | ||
<Modal | ||
open={isModal} | ||
onClose={handleClose} | ||
aria-labelledby="modal-modal-title" | ||
aria-describedby="modal-modal-description" | ||
> | ||
<Box | ||
sx={{ | ||
position: "absolute" as "absolute", | ||
top: "50%", | ||
left: "50%", | ||
transform: "translate(-50%, -50%)", | ||
width: "606px", | ||
bgcolor: "background.paper", | ||
boxShadow: "0px 4px 30px rgba(4, 20, 32, 0.1)", | ||
borderRadius: "4px", | ||
}} | ||
> | ||
</Box> | ||
</Modal> | ||
</div> | ||
); | ||
}; | ||
|
||
export default OrdersModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from "react"; | ||
import { Box } from "@mui/material"; | ||
|
||
import PaginationInput from "./PaginationInput"; | ||
import PaginationButtons from "./PaginationButtons"; | ||
import { useAppSelector } from "../../hooks/customHooks"; | ||
import { selectTotalPages } from "../../store/reducers/ordersSlice"; | ||
|
||
const OrdersPagination: React.FC = () => { | ||
const totalPages = useAppSelector(selectTotalPages); | ||
|
||
return ( | ||
<Box | ||
id="pagination" | ||
sx={{ | ||
display: "flex", | ||
alignItems: "center", | ||
padding: "20px 12px 42px", | ||
}} | ||
> | ||
{totalPages > 1 && ( | ||
<> | ||
<PaginationButtons /> | ||
<PaginationInput /> | ||
</> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default OrdersPagination; |
Oops, something went wrong.