Skip to content

Commit

Permalink
ADD: second part of the admin refont without journeys system
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime SAME-KOTTO authored and Maxime SAME-KOTTO committed Dec 27, 2023
1 parent 6938f9f commit 90f7d57
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 699 deletions.
102 changes: 64 additions & 38 deletions src/component/JourneyTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,86 @@ import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
import { Container, IconButton } from "@mui/material";
import EditIcon from "@mui/icons-material/Edit";
import RoomIcon from '@mui/icons-material/Room';
import RoomIcon from "@mui/icons-material/Room";
import ClearIcon from "@mui/icons-material/Clear";
import "../styles/component/MarkerTable.css";

export const JourneyTable = ({ rows, showRow, editRow, deleteRow }) => {
export const JourneyTable = ({
rows,
showRow,
editRow,
deleteRow,
withoutAction,
}) => {
return (
<Container className="table-container">
<TableContainer>
<Table aria-label="simple table">
<TableHead>
<TableRow>
<TableCell>S.No</TableCell>
<TableCell align="right">Journeys Name</TableCell>
<TableCell align="right">Afficher</TableCell>
<TableCell align="right">Modifier</TableCell>
<TableCell align="right">Supprimer</TableCell>
{withoutAction ? (
<>
<TableCell align="center">S.No</TableCell>
<TableCell align="center">Journeys Name</TableCell>
</>
) : (
<>
<TableCell>S.No</TableCell>
<TableCell align="right">Journeys Name</TableCell>
<TableCell align="right">Afficher</TableCell>
<TableCell align="right">Modifier</TableCell>
<TableCell align="right">Supprimer</TableCell>
</>
)}
</TableRow>
</TableHead>
<TableBody>
{rows &&
rows.map((row, id) => (
<TableRow key={id}>
<TableCell component="th" scope="row">
{row.id}
</TableCell>
<TableCell align="right">{row.name}</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
showRow(row.id);
}}
>
<RoomIcon />
</IconButton>
</TableCell>
{withoutAction ? (
<>
<TableCell align="center" component="th" scope="row">
{row.id}
</TableCell>
<TableCell align="center">{row.name}</TableCell>
</>
) : (
<>
<TableCell component="th" scope="row">
{row.id}
</TableCell>
<TableCell align="right">{row.name}</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
showRow(row.id);
}}
>
<RoomIcon />
</IconButton>
</TableCell>

<TableCell align="right">
<IconButton
onClick={() => {
editRow(id);
}}
>
<EditIcon />
</IconButton>
</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
deleteRow(row.id);
}}
>
<ClearIcon />
</IconButton>
</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
editRow(id);
}}
>
<EditIcon />
</IconButton>
</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
deleteRow(row.id);
}}
>
<ClearIcon />
</IconButton>
</TableCell>
</>
)}
</TableRow>
))}
</TableBody>
Expand Down
42 changes: 25 additions & 17 deletions src/component/MarkerModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,7 @@ export const MarkerModal = ({ closeModal, onSubmit, defaultValue }) => {
return (
<Container className="modal-container">
<Container className="modal-body">
<Container className="modal-header">
<Typography
variant={"h1"}
color={"black"}
style={{
marginBottom: "1rem",
fontSize: "3.75rem",
letterSpacing: "-0.025em",
fontWeight: 800,
}}
>
Test
</Typography>
<Container style={{display: 'flex', alignItems: "flex-end", justifyContent: 'flex-end'}}>
<IconButton onClick={() => closeModal()}>
<CloseIcon />
</IconButton>
Expand All @@ -93,7 +81,7 @@ export const MarkerModal = ({ closeModal, onSubmit, defaultValue }) => {
name="name"
defaultValue={formData.name}
label="Name"
style={{ width: "100%"}}
style={{ width: "100%" }}
/>
</div>
<div className="modal-form-field">
Expand All @@ -104,7 +92,7 @@ export const MarkerModal = ({ closeModal, onSubmit, defaultValue }) => {
label="Description"
multiline
className="modal-form-field"
style={{ width: "100%"}}
style={{ width: "100%" }}
/>
</div>
<div className="modal-form-field">
Expand All @@ -114,7 +102,7 @@ export const MarkerModal = ({ closeModal, onSubmit, defaultValue }) => {
defaultValue={formData.longitude}
label="Longitude"
className="modal-form-field"
style={{ width: "100%"}}
style={{ width: "100%" }}
/>
</div>
<div className="modal-form-field">
Expand All @@ -123,7 +111,27 @@ export const MarkerModal = ({ closeModal, onSubmit, defaultValue }) => {
name="latitude"
defaultValue={formData.latitude}
label="Latitude"
style={{ width: "100%"}}
style={{ width: "100%" }}
/>
</div>
<div className="modal-form-field">
<TextField
onChange={handleChange}
name="status"
defaultValue={formData.longitude}
label="Status"
className="modal-form-field"
style={{ width: "100%" }}
/>
</div>
<div className="modal-form-field">
<TextField
onChange={handleChange}
name="order"
defaultValue={formData.longitude}
label="Order"
className="modal-form-field"
style={{ width: "100%" }}
/>
</div>
{errors && (
Expand Down
2 changes: 2 additions & 0 deletions src/component/MarkerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const MarkerTable = ({ rows, editRow, deleteRow }) => {
<TableCell align="right">Latitude</TableCell>
<TableCell align="right">Longitude</TableCell>
<TableCell align="right">Status</TableCell>
<TableCell align="right">Order</TableCell>
<TableCell align="right">Modifier</TableCell>
<TableCell align="right">Supprimer</TableCell>
</TableRow>
Expand All @@ -39,6 +40,7 @@ export const MarkerTable = ({ rows, editRow, deleteRow }) => {
<TableCell align="right">{row.longitude}</TableCell>
<TableCell align="right">{row.latitude}</TableCell>
<TableCell align="right">{"Not Ready"}</TableCell>
<TableCell align="right">{"Not Ready"}</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
Expand Down
3 changes: 3 additions & 0 deletions src/component/OrganisationsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const OrganisationsTable = ({ rows, addOrg, deleteOrg, editOrg, showOrg }) => {
<TableRow>
<TableCell>S.No</TableCell>
<TableCell align="right">Name</TableCell>
<TableCell align="right">Afficher</TableCell>
<TableCell align="right">Supprimer</TableCell>

</TableRow>
</TableHead>
<TableBody>
Expand Down
7 changes: 7 additions & 0 deletions src/component/admin/MarkerModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ export const AdminMarkerModal = ({ closeModal, onSubmit, defaultValue }) => {
style={{width: "100%"}}
/>
</div>
<div className="modal-form-field">
<TextField
name="order"
label="Order"
style={{width: "100%"}}
/>
</div>
<div className="modal-form-field">
<p>Model 3D</p>
<Input type="file" />
Expand Down
2 changes: 2 additions & 0 deletions src/component/admin/MarkerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const AdminMarkerTable = ({ rows, editMarker, deleteMarker }) => {
<TableCell align="right">Latitude</TableCell>
<TableCell align="right">Longitude</TableCell>
<TableCell align="right">Status</TableCell>
<TableCell align="right">Order</TableCell>
<TableCell align="right">Modifier</TableCell>
<TableCell align="right">Supprimer</TableCell>
</TableRow>
Expand All @@ -64,6 +65,7 @@ export const AdminMarkerTable = ({ rows, editMarker, deleteMarker }) => {
<TableCell align="right">{row.longitude}</TableCell>
<TableCell align="right">{row.latitude}</TableCell>
<TableCell align="right">{"Not Ready"}</TableCell>
<TableCell align="right">{"Not Ready"}</TableCell>
<TableCell align="right">
<IconButton
onClick={() => {
Expand Down
Loading

0 comments on commit 90f7d57

Please sign in to comment.