From 0f5dec07842d75ab0a4759d337fb2e6911c943b8 Mon Sep 17 00:00:00 2001 From: AgataS23 Date: Sat, 17 Dec 2022 12:23:08 +0100 Subject: [PATCH] Added component TableCellCities --- src/components/AppLayout/AppLayout.tsx | 67 +++++++++++-------- .../TableCellCities/TableCellCities.tsx | 47 +++++++++++++ 2 files changed, 86 insertions(+), 28 deletions(-) create mode 100644 src/components/TableCellCities/TableCellCities.tsx diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index a41ea2f..612b542 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -1,32 +1,43 @@ -import { Outlet, Link } from 'react-router-dom'; -import Box from '@mui/material/Box'; -import List from '@mui/material/List'; -import ListItem from '@mui/material/ListItem'; -import ListItemIcon from '@mui/material/ListItemIcon'; -import ListItemText from '@mui/material/ListItemText'; -import Star from '@mui/icons-material/Star'; -import { paths } from '../../paths'; -import Sidebar from './Sidebar'; +import { Outlet, Link } from "react-router-dom"; +import Box from "@mui/material/Box"; +import List from "@mui/material/List"; +import ListItem from "@mui/material/ListItem"; +import ListItemIcon from "@mui/material/ListItemIcon"; +import ListItemText from "@mui/material/ListItemText"; +import Star from "@mui/icons-material/Star"; +import { paths } from "../../paths"; +import Sidebar from "./Sidebar"; +import TableCellCities from "../TableCellCities/TableCellCities"; +const rows = [{ + id: 1, + city: "Kraków", +}, +{ id: 2, city: "Pokhara" }, +{ id: 3, city: "Den Haag" }, +{ id: 4, city: "Praha" },] -const AppLayout = () => { - return ( - - - - {paths.map(({ path, label, iconComponent }) => ( - - {iconComponent ? iconComponent : } - - - ))} - - - - - +const AppLayout = () => ( + + + + {paths.map(({ path, label, iconComponent }) => ( + + + {iconComponent ? iconComponent : } + + + + ))} + + + + <> + + {rows} + - ) -} + +); -export default AppLayout \ No newline at end of file +export default AppLayout; diff --git a/src/components/TableCellCities/TableCellCities.tsx b/src/components/TableCellCities/TableCellCities.tsx new file mode 100644 index 0000000..d85d6fe --- /dev/null +++ b/src/components/TableCellCities/TableCellCities.tsx @@ -0,0 +1,47 @@ +import { + TableContainer, + Paper, + Table, + TableHead, + TableRow, + TableBody, +} from "@mui/material"; +import TableCell from "@mui/material/TableCell"; + +interface TableCellCitiesProps { + children: Array<{ id: number; city: string }>; +} + +const TableCellCities = ({ children }: TableCellCitiesProps) => { + return ( + + + + + Cities + + + + {children.map(({id, city}) => ( + + + {city} + + + ))} + +
+
+ ); +}; + +// const Test = () => { +// return ( +// <> +// Krakow +// Rzeszow +// Warszawa +// +// ); +// }; +export default TableCellCities;