Skip to content

Commit a0cdcc6

Browse files
authored
Merge pull request #50 from untilhamza/release/v1.9.0
Release/v1.9.0
2 parents 910619b + e6b0ced commit a0cdcc6

File tree

6 files changed

+55
-50
lines changed

6 files changed

+55
-50
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
.env
1717
.env.local
1818
.env.development.local
19+
.env.development.local_
1920
.env.test.local
2021
.env.production.local
2122

src/components/Booking/Booking.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import React from "react"
2-
import Button from "react-bootstrap/esm/Button"
3-
import Badge from "react-bootstrap/Badge"
4-
import "./Booking.css"
5-
import { setStatus } from "../../util/helpers"
1+
import React from "react";
2+
import Button from "react-bootstrap/esm/Button";
3+
import Badge from "react-bootstrap/Badge";
4+
import "./Booking.css";
5+
import { setStatus } from "../../util/helpers";
66

77
const Booking = ({ booking, onView }) => {
8-
const { name, time, status, id } = booking
8+
// console.log("booking", booking);
9+
const { name, time, status, id, phone } = booking;
910

1011
function handleView() {
11-
onView(id)
12+
onView(id);
1213
}
1314

1415
return (
1516
<tr>
1617
<td className="text-center py-2 booking-time table-body-text">{time}</td>
17-
<td className="text-start py-2 customer-name table-body-text">{name}</td>
18+
<td className="text-start py-2 customer-name table-body-text">{`${name}\n ${phone}`}</td>
1819
<td className="text-center py-2 table-body-text">
1920
<Badge pill bg={`${setStatus(status)}`} className="py-2 px-2 px-sm-3">
2021
{status}
@@ -29,7 +30,7 @@ const Booking = ({ booking, onView }) => {
2930
</td>
3031
{}
3132
</tr>
32-
)
33-
}
33+
);
34+
};
3435

35-
export default Booking
36+
export default Booking;

src/components/NavBar/Navbar.js

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { useState } from "react"
1+
import { useState } from "react";
22
// import { useContext } from "react"
33
// import AuthContext from "../../store/auth-context"
4-
import { Navbar as RbNavbar, Container, Nav } from "react-bootstrap"
5-
import { NavLink } from "react-router-dom"
4+
import { Navbar as RbNavbar, Container, Nav } from "react-bootstrap";
5+
import { NavLink } from "react-router-dom";
66
// import Button from "@mui/material/Button"
7-
import * as FaIcons from "react-icons/fa"
8-
import SideBar from "../SideBar/SideBar"
7+
import * as FaIcons from "react-icons/fa";
8+
import SideBar from "../SideBar/SideBar";
99

10-
import "./NavBar.css"
10+
import "./NavBar.css";
1111
const Navbar = () => {
12-
const [showSidebar, setShowSidebar] = useState(false)
12+
const [showSidebar, setShowSidebar] = useState(false);
1313

14-
const handleToggleSidebar = () => setShowSidebar((isShown) => !isShown)
14+
const handleToggleSidebar = () => setShowSidebar((isShown) => !isShown);
1515

1616
// const authCtx = useContext(AuthContext)
1717
return (
@@ -21,11 +21,7 @@ const Navbar = () => {
2121
<NavLink to="/"> Elkpro Cut</NavLink>
2222
</RbNavbar.Brand>
2323
<Nav className="ms-auto">
24-
<NavLink
25-
className="nav-link nav-item"
26-
activeClassName="active"
27-
to="/"
28-
>
24+
<NavLink className="nav-link nav-item" activeClassName="active" to="/">
2925
Booking
3026
</NavLink>
3127

@@ -49,7 +45,7 @@ const Navbar = () => {
4945
<SideBar show={showSidebar} onToggle={handleToggleSidebar} />
5046
</Container>
5147
</RbNavbar>
52-
)
53-
}
48+
);
49+
};
5450

55-
export default Navbar
51+
export default Navbar;

src/components/SideBar/SideBar.js

+29-19
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import * as AiIcons from "react-icons/ai"
2-
import "./SideBar.css"
3-
import { IconContext } from "react-icons"
4-
import { Link } from "react-router-dom"
5-
import { Backdrop } from "@mui/material"
6-
import { SIDEITEMS } from "../../util/data"
7-
import { useContext } from "react"
8-
import AuthContext from "../../store/auth-context"
1+
import * as AiIcons from "react-icons/ai";
2+
import "./SideBar.css";
3+
import { IconContext } from "react-icons";
4+
import { Link } from "react-router-dom";
5+
import { Backdrop } from "@mui/material";
6+
import { SIDEITEMS } from "../../util/data";
7+
import { useContext } from "react";
8+
import AuthContext from "../../store/auth-context";
9+
import styled from "styled-components";
10+
import version from "../../version.json";
911

1012
const SideBar = ({ show, onToggle }) => {
11-
const authCtx = useContext(AuthContext)
13+
const authCtx = useContext(AuthContext);
1214

1315
const handleToggleSidebar = () => {
14-
onToggle()
15-
}
16+
onToggle();
17+
};
1618
return (
1719
<>
1820
{show && (
@@ -23,7 +25,6 @@ const SideBar = ({ show, onToggle }) => {
2325
<div className="side-bar__close">
2426
<AiIcons.AiOutlineClose className="side-bar__crossIcon" />
2527
</div>
26-
2728
<ul className="side-list">
2829
{SIDEITEMS.reduce((items, item, index) => {
2930
const listItem = (
@@ -33,22 +34,31 @@ const SideBar = ({ show, onToggle }) => {
3334
<span>{item.title}</span>
3435
</Link>
3536
</li>
36-
)
37+
);
3738
if (!item.protected) {
38-
items.push(listItem)
39+
items.push(listItem);
3940
}
4041
if (item.protected && authCtx.isLoggedIn) {
41-
items.push(listItem)
42+
items.push(listItem);
4243
}
43-
return items
44+
return items;
4445
}, [])}
4546
</ul>
47+
<Version>Version : {version.version}</Version>
4648
</nav>
4749
</IconContext.Provider>
4850
</>
4951
)}
5052
</>
51-
)
52-
}
53+
);
54+
};
55+
56+
export default SideBar;
5357

54-
export default SideBar
58+
const Version = styled.span`
59+
font-size: 0.8rem;
60+
color: #fff;
61+
margin-top: auto;
62+
display: block;
63+
text-align: center;
64+
`;

src/version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "1.3.3"
2+
"version": "1.9.0"
33
}

version.json

-3
This file was deleted.

0 commit comments

Comments
 (0)