diff --git a/frontend/README.md b/frontend/README.md index 58beeac..2bbd7bc 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -68,3 +68,31 @@ This section has moved here: [https://facebook.github.io/create-react-app/docs/d ### `npm run build` fails to minify This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) + + + + +Smart Electronics +Smart Watches +Smart Watch Phone +Smart Wristband +Smart Watch Accessories +Sport Watch +Smart Health Watch +Security & Protection +Access Control +Alarm Systems +Door Intercom +IP Cameras +Smart Doorbells +Surveillance Camera System + +Headphones & Earphones +Bluetooth Headphones +Earbud Headphones +Gaming Headphones +On-Ear & Over-Ear Headphones +Sports & Fitness Headphones +Headphone Accessories +Xiaomi Ecosystem Products +Xiaomi \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ef6c306..39e59ca 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -11,12 +11,14 @@ "@chakra-ui/react": "^2.3.7", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", + "@fortawesome/fontawesome-free": "^6.2.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "axios": "^1.1.3", "bootstrap": "^5.2.2", "framer-motion": "^6.5.1", + "mdb-react-ui-kit": "^5.0.0", "react": "^18.2.0", "react-bootstrap": "^2.6.0", "react-dom": "^18.2.0", @@ -3461,6 +3463,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@fortawesome/fontawesome-free": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.0.tgz", + "integrity": "sha512-CNR7qRIfCwWHNN7FnKUniva94edPdyQzil/zCwk3v6k4R6rR2Fr8i4s3PM7n/lyfPA6Zfko9z5WDzFxG9SW1uQ==", + "hasInstallScript": true, + "engines": { + "node": ">=6" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.7", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", @@ -7167,6 +7178,14 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==", + "engines": { + "node": ">=6" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -13399,6 +13418,31 @@ "tmpl": "1.0.5" } }, + "node_modules/mdb-react-ui-kit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mdb-react-ui-kit/-/mdb-react-ui-kit-5.0.0.tgz", + "integrity": "sha512-1K9cg+YqQyTCJtFg30aWJ+DExn+w4ayL6ZyHR7E0VilAFBsioPNPqTGV4ZJdHffUEVvglNyz0UXe0bYHq5n7aQ==", + "dependencies": { + "@popperjs/core": "2.11.5", + "clsx": "1.1.1", + "react-popper": "2.3.0" + }, + "peerDependencies": { + "@types/react": "^18.0.9", + "@types/react-dom": "^18.0.3", + "react": "^18.1.0", + "react-dom": "^18.1.0" + } + }, + "node_modules/mdb-react-ui-kit/node_modules/@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/mdn-data": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", @@ -15979,6 +16023,20 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, + "node_modules/react-popper": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz", + "integrity": "sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==", + "dependencies": { + "react-fast-compare": "^3.0.1", + "warning": "^4.0.2" + }, + "peerDependencies": { + "@popperjs/core": "^2.0.0", + "react": "^16.8.0 || ^17 || ^18", + "react-dom": "^16.8.0 || ^17 || ^18" + } + }, "node_modules/react-redux": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", @@ -21494,6 +21552,11 @@ } } }, + "@fortawesome/fontawesome-free": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.0.tgz", + "integrity": "sha512-CNR7qRIfCwWHNN7FnKUniva94edPdyQzil/zCwk3v6k4R6rR2Fr8i4s3PM7n/lyfPA6Zfko9z5WDzFxG9SW1uQ==" + }, "@humanwhocodes/config-array": { "version": "0.11.7", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", @@ -24266,6 +24329,11 @@ "wrap-ansi": "^7.0.0" } }, + "clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -28823,6 +28891,23 @@ "tmpl": "1.0.5" } }, + "mdb-react-ui-kit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mdb-react-ui-kit/-/mdb-react-ui-kit-5.0.0.tgz", + "integrity": "sha512-1K9cg+YqQyTCJtFg30aWJ+DExn+w4ayL6ZyHR7E0VilAFBsioPNPqTGV4ZJdHffUEVvglNyz0UXe0bYHq5n7aQ==", + "requires": { + "@popperjs/core": "2.11.5", + "clsx": "1.1.1", + "react-popper": "2.3.0" + }, + "dependencies": { + "@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==" + } + } + }, "mdn-data": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", @@ -30508,6 +30593,15 @@ } } }, + "react-popper": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz", + "integrity": "sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==", + "requires": { + "react-fast-compare": "^3.0.1", + "warning": "^4.0.2" + } + }, "react-redux": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index 3e174b1..05c8c52 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,12 +6,14 @@ "@chakra-ui/react": "^2.3.7", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", + "@fortawesome/fontawesome-free": "^6.2.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "axios": "^1.1.3", "bootstrap": "^5.2.2", "framer-motion": "^6.5.1", + "mdb-react-ui-kit": "^5.0.0", "react": "^18.2.0", "react-bootstrap": "^2.6.0", "react-dom": "^18.2.0", diff --git a/frontend/public/index.html b/frontend/public/index.html index aa069f2..00f7fae 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -9,6 +9,7 @@ name="description" content="Web site created using create-react-app" /> + */ +@media screen and (max-width: 800px) { + .containerFooter { + display: block; + padding-left: 2%; + } + .newslter{ +margin-top: -22%; + } + .newslter > div:last-child { + display: none; + } + .newslter > div:first-child { + width: 95%; /* border: 1px solid red; */ + margin: auto; + font-size: 13px; + padding-left: -20%; } - .qualitySection>div:first-child>img{ -width: 150px; -height: 50px; -margin-top: 7%; + .newslter > div:first-child > input { + width: 45%; + height: 35px; } - .qualitySection>div:first-child>p{ - font-weight: bold; - font-size: 14px; - } - - .qualitySection>div:first-child~img{ - width: 680px; - height: 110px; - } \ No newline at end of file + .newslter > div:first-child>input ~ button { + width: 33%; + height: 35px; + } + .qualitySection > div:first-child ~ img { + display: none; + } + .qualitySection > div:first-child > img { +display: none; + } + + .qualitySection > div:first-child > p { +display: none; + } +} diff --git a/frontend/src/Components/Navbar/MenuDropdown.jsx b/frontend/src/Components/Navbar/MenuDropdown.jsx deleted file mode 100644 index e1b3dda..0000000 --- a/frontend/src/Components/Navbar/MenuDropdown.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import Carousel from 'react-bootstrap/Carousel'; - -function MenuDropown() { - return ( - - - First slide - -

First slide label

-

Nulla vitae elit libero, a pharetra augue mollis interdum.

-
-
- - Second slide - - -

Second slide label

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
- - Third slide - - -

Third slide label

-

- Praesent commodo cursus magna, vel scelerisque nisl consectetur. -

-
-
-
- ); -} - -export default MenuDropown; \ No newline at end of file diff --git a/frontend/src/Components/Navbar/Navbar.jsx b/frontend/src/Components/Navbar/Navbar.jsx index 2085a52..93f406e 100644 --- a/frontend/src/Components/Navbar/Navbar.jsx +++ b/frontend/src/Components/Navbar/Navbar.jsx @@ -1,88 +1,109 @@ import React from "react"; -import styles from "../Navbar/Navbar.module.css"; +import styles from "./Navbar.module.css"; import { BsChevronDown } from "react-icons/bs"; import { IoIosPhonePortrait } from "react-icons/io"; -import { HiOutlineUser, HiOutlineHeart } from "react-icons/hi"; +import { HiOutlineHeart } from "react-icons/hi"; import { FiShoppingCart } from "react-icons/fi"; import { BiSearch } from "react-icons/bi"; import Signinfunction from "./Signinfunction.jsx"; -import SideNavbar from "./SideNavbar" +import NavbarCarousel from "./NavbarCarousel"; +import SideNavbar from "./SideNavbar"; const Navbar = () => { - const menuItems = [ + const menuItems = [ { - title: 'SUPER DEALS', - url: '/SUPER_DEALS', + title: "SUPER DEALS", + url: "/SUPER_DEALS", }, { - title: 'APP ONLY', - url: '/APP_ONLY', + title: "APP ONLY", + url: "/APP_ONLY", }, { - title: 'NEW ARRIVALS', - url: '/NEW_ARRIVALS', - } + title: "NEW ARRIVALS", + url: "/NEW_ARRIVALS", + }, ]; - + return ( -
-
- {/* */} -
- -
-
-

- {" "} - Save $3 with - App {" "} -

-

- {" "} - Support Center {" "} -

-

- {" "} - Language {" "} -

-

- {" "} - Country Website {" "} -

-
-
-
- - + <> +
+
+ {/* */} +
+ +
+
+

+ {" "} + Save $3 + with App {" "} +

+

+ {" "} + Support Center {" "} +

+

+ {" "} + Language {" "} +

- + {" "} + Country Website {" "}

-

- - - -

Favourites

-
+
+
+ + +

+ +

+
+

+ +

+ + +

Favourites

+
- - -

Cart

-
+ + +

Cart

+
+
-
- - {menuItems.map((e)=>( -

{e.title}

- ))} +
+ +
+ + +

+ +

+
+
+ +
+
+
+ +
+
-
+ ); }; diff --git a/frontend/src/Components/Navbar/Navbar.module.css b/frontend/src/Components/Navbar/Navbar.module.css index ac0241a..222a23e 100644 --- a/frontend/src/Components/Navbar/Navbar.module.css +++ b/frontend/src/Components/Navbar/Navbar.module.css @@ -1,11 +1,10 @@ -.outerbar{ - position: sticky; - background-color:rgb(253, 250, 250); - border-color: white; -top:0; -box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; - /* border: 1px solid red; */ - +.outerbar { + position: sticky; + background-color: rgb(253, 250, 250); + border-color: white; + top: 0; + box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; + /* border: 1px solid red; */ } .containerNavbar { width: 95%; @@ -55,83 +54,200 @@ box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; margin-top: 0%; font-size: 18px; } - +.midScreenNavbar{ + display: none; +} .navbarSearchSection { height: 65px; /* border: 1px solid black; */ -padding-top: 2%; + padding-top: 2%; display: flex; justify-content: space-between; } -.navbarSearchSection>div{ - width:60%; - height: 38px; - border-radius: 40px; - display: flex; - border:2px solid #ffda00; + +.navbarSearchSection > div { + width: 60%; + height: 38px; + border-radius: 40px; + display: flex; + border: 2px solid #ffda00; } -.navbarSearchSection>div>input{ - width:83%; - height: 100%; - padding-left: 3%; - /* border:2px solid #04c74f; */ +.navbarSearchSection > div > input { + width: 83%; + height: 100%; + padding-left: 3%; + /* border:2px solid #04c74f; */ } -.navbarSearchSection>div>input:focus{ - Outline:none !important - } - +.navbarSearchSection > div > input:focus { + outline: none !important; +} -.navbarSearchSection>div>p{ - padding-top: 1.5%; - width: 9%; - padding-left: 2%; - padding-right: 10px; - border-top-right-radius: 18px; - border-bottom-right-radius: 18px; - background-color: #ffda00; +.navbarSearchSection > div > p { + padding-top: 1.5%; + width: 9%; + padding-left: 2%; + padding-right: 10px; + border-top-right-radius: 18px; + border-bottom-right-radius: 18px; + background-color: #ffda00; } -.navbarSearchSection>div>select{ - width: 8%; - padding-left: -1%; - font-size: 14px; - padding-right: -10%; - border: none; - margin-left: 3%; - /* border:2px solid #04c74f; */ +.navbarSearchSection > div > select { + width: 8%; + padding-left: -1%; + font-size: 14px; + padding-right: -10%; + border: none; + margin-left: 3%; + /* border:2px solid #04c74f; */ } -.navbarSearchSection>a{ - display: flex; - margin-top: 1%; +.navbarSearchSection > a { + display: flex; + margin-top: 1%; } -.navbarSearchSection>a>p{ - margin-top: -1%; - margin-left: 5px; - color: grey; - } +.navbarSearchSection > a > p { + margin-top: -1%; + margin-left: 5px; + color: grey; +} - .mainDropdown{ +.mainDropdown { width: 95%; height: 50px; margin: auto; - color:black; - margin-top:2px; - background:#ffda00; + color: black; + margin-top: 2px; + background: #ffda00; display: flex; - padding-left: 4%; - /* padding-right: 4%; */ font-size: 14px; font-weight: 500; - padding-top: 1%; - justify-content: left; + /* padding-top: 1%; */ + justify-content: left; } -.mainDropdown>p{ +.mainDropdown > div { font-weight: 700; - margin-right: 12%; -} \ No newline at end of file + /* border: 1px solid red; */ + /* margin-right: 12%; */ + padding: 18px 85px; +} + +.mainDropdown > div:first-child { + background-color: black; + color: white; +} + +.megaDropdownBox { + width: 95%; + margin: auto; + height: 420px; + /* border: 1px solid green; */ +} +.sideNavBtn { + width: 95%; + background: #ffda00; + margin: auto; +} + +.navbardropdownName { + font-weight: bold; + color: black; + margin-left: -90%; + padding-top: 0%; + padding-bottom: 0%; +} + +.carouselNavabr{ + height:417px; width:100% +} +.footerLogoNavbarDropdown{ + display: none; +} + + +.midSectionSign{ + display: none; +} +/* <----------------------------------------------min screen---------------------> */ +@media screen and (max-width: 800px) { + .outerbar { + display: none; + } + + .sideNavBtn { + width: 95%; + padding-left: 50%; + } + + .sideNavbarCompo{ + position:sticky; + z-index: 10; + top:0; + } + .navbardropdownName { + color: black; + font-size: 14px; + margin-left: -80%; + + } + .carouselNavabr{ + height:307px; width:100% + } + + + .footerLogoNavbarDropdown{ + display: flex; + margin-top: 2%; + width: 100%; + margin-left: 2.3%; + margin-bottom: 2%; + height: 30px; + + background-color: white; + } + .footerLogoNavbarDropdown>img{ + display: block; + margin-top: 0%; + width: 25%; + height: 30px; + background-color: white; + } + .midScreenNavbar{ + width: 42.8%; + margin-right: -0.3%; + margin-left: 2%; + height: 28px; + border-radius: 40px; + display: flex; + border: 2px solid #ffda00; + } + .midScreenNavbar>input{ + font-size: 12px; + /* border: 1px solid red; */ + width: 59%; + margin-right: 1%; + } + .midScreenNavbar>select{ + /* border: 1px solid red; */ +width: 21%; +border-bottom-left-radius: 10px; +border-top-left-radius: 10px; + +margin-left: 1%; +font-size: 10px; + } + + .midSectionSign{ + display: block; +font-size: px; +width: 1%; +height:5%; +margin-top: -2%; +border: 1px solid red; + } +} diff --git a/frontend/src/Components/Navbar/NavbarCarousel.jsx b/frontend/src/Components/Navbar/NavbarCarousel.jsx new file mode 100644 index 0000000..37a2549 --- /dev/null +++ b/frontend/src/Components/Navbar/NavbarCarousel.jsx @@ -0,0 +1,34 @@ +import Carousel from 'react-bootstrap/Carousel'; +import styles from "./Navbar.module.css" + +function NavbarCarousel() { + + const carouselData =[ + {img:"https://uidesign.gbtcdn.com/GB/image/8823/electronics_1190x420_en.jpg"}, + {img:"https://uidesign.gbtcdn.com/GB/image/8823/en_1190x420.jpg?imbypass=true"}, + {img:"https://uidesign.gbtcdn.com/GB/image/8823/printer_1190x420_en.jpg"}, + {img:"https://uidesign.gbtcdn.com/GB/image/8823/home_1190x420_en.jpg"}, + {img:"https://uidesign.gbtcdn.com/GB/image/8823/ortur_master3_1190X420_en.jpg"}, + {img:"https://uidesign.gbtcdn.com/GB/image/8823/1190X420.jpg"} + + ] + + return ( + + {carouselData.map((e)=>( + + First slide + + ))} + + + ); +} + +export default NavbarCarousel; \ No newline at end of file diff --git a/frontend/src/Components/Navbar/SideNavbar.jsx b/frontend/src/Components/Navbar/SideNavbar.jsx index 11c0079..035fc3e 100644 --- a/frontend/src/Components/Navbar/SideNavbar.jsx +++ b/frontend/src/Components/Navbar/SideNavbar.jsx @@ -1,45 +1,134 @@ -import React from 'react' +import React from "react"; import { - Drawer, - DrawerBody, - DrawerHeader, - DrawerOverlay, - DrawerContent,Button, DrawerCloseButton -} from '@chakra-ui/react' - import { useDisclosure } from '@chakra-ui/react' + MDBContainer, + MDBCol, + MDBNavbar, + MDBNavbarNav, + MDBNavbarItem, + MDBNavbarLink, + MDBDropdown, + MDBDropdownToggle, + MDBDropdownMenu, + MDBListGroup, + MDBListGroupItem, + MDBRow, + MDBIcon +} from 'mdb-react-ui-kit'; +import styles from "./Navbar.module.css" const SideNavbar = () => { - const { isOpen, onOpen, onClose } = useDisclosure() - const btnRef = React.useRef() - return ( - <> - - - {/* */} - - - Create your account - - - {/* */} - -{/* - - - - */} - - - - ) - } - export default SideNavbar \ No newline at end of file + return ( + + + + + + + + + + + + CATEGORY + + + + + + + + + Consumer Electronics + + + Smart Electronics + + + + Headphones & Earphones + + + + Xiaomi Ecosystem Products + + + + Security & Protection + + + + + + + Industrial & Scientific + + + 3D Printer & Supplies + + + + Laser Engraver & CNC + + + Power Tools + + + Professional Tools + + + + + + + Computers & Tablets + + + Computers & Tablets + + + Computer Peripherals + + + Computer Components + + + Ofice Supply + + + + + + + Health & Personal Care + + + Health Care + + + Beauty Care Tools + + + Shaving & Hair Removal + + + Body scales + + + + + + + + + + + + ); +} +export default SideNavbar; diff --git a/frontend/src/Components/Navbar/SideNavbar.module.css b/frontend/src/Components/Navbar/SideNavbar.module.css new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/Pages/Home/AdminLogin.jsx b/frontend/src/Pages/Home/AdminLogin.jsx deleted file mode 100644 index 3a4ac94..0000000 --- a/frontend/src/Pages/Home/AdminLogin.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -const AdminLogin = () => { - return ( -
AdminLogin
- ) -} - -export default AdminLogin \ No newline at end of file diff --git a/frontend/src/Pages/Home/HomePage.jsx b/frontend/src/Pages/Home/HomePage.jsx index a082c29..2c15c22 100644 --- a/frontend/src/Pages/Home/HomePage.jsx +++ b/frontend/src/Pages/Home/HomePage.jsx @@ -2,7 +2,10 @@ import React from 'react' const HomePage = () => { return ( -
HomePage
+
HomePage + + +
) } diff --git a/frontend/src/Pages/Home/UserLogin.jsx b/frontend/src/Pages/Home/UserLogin.jsx deleted file mode 100644 index d22bcad..0000000 --- a/frontend/src/Pages/Home/UserLogin.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -const UserLogin = () => { - return ( -
UserLogin
- ) -} - -export default UserLogin \ No newline at end of file diff --git a/frontend/src/Pages/Login/AdminLogin.jsx b/frontend/src/Pages/Login/AdminLogin.jsx new file mode 100644 index 0000000..54234c4 --- /dev/null +++ b/frontend/src/Pages/Login/AdminLogin.jsx @@ -0,0 +1,111 @@ +import { + Flex, + Box, + FormControl, + FormLabel, + Input, + Checkbox, + Stack, + Link, + Button, + Heading, + Text, + useColorModeValue, +} from "@chakra-ui/react"; +import { useState } from "react"; +import axios from "axios"; + +function AdminLogin() { + const [validated, setValidated] = useState(false); + + const [formData, setFormData] = useState({ + Email: "", + Password: "", + }); + + const handleChange = (e) => { + const { name, value } = e.target; + setFormData({ + ...formData, + [name]: value, + }); + }; + + console.log("formDataaabnj", formData); + + const handleSubmit = (e) => { + + e.preventDefault(); + axios + .post("http://localhost:5000/user/login", formData) + .then((e) => { + console.log(e); + localStorage.setItem("token", e.data.token); + }) + .catch((err) => console.log(err)); + }; + + return ( + + + + Sign in to your Admin account + + + + + + Email address + + + Password + + + + + Remember me + Forgot password? + + + + + + + + ); +} +export default AdminLogin; diff --git a/frontend/src/Pages/Login/UserLogin.jsx b/frontend/src/Pages/Login/UserLogin.jsx new file mode 100644 index 0000000..a16ac84 --- /dev/null +++ b/frontend/src/Pages/Login/UserLogin.jsx @@ -0,0 +1,111 @@ +import { + Flex, + Box, + FormControl, + FormLabel, + Input, + Checkbox, + Stack, + Link, + Button, + Heading, + Text, + useColorModeValue, +} from "@chakra-ui/react"; +import { useState } from "react"; +import axios from "axios"; + +function UserLogin() { + const [validated, setValidated] = useState(false); + + const [formData, setFormData] = useState({ + Email: "", + Password: "", + }); + + const handleChange = (e) => { + const { name, value } = e.target; + setFormData({ + ...formData, + [name]: value, + }); + }; + + console.log("formDataaabnj", formData); + + const handleSubmit = (e) => { + + e.preventDefault(); + axios + .post("http://localhost:5000/user/login", formData) + .then((e) => { + console.log(e); + localStorage.setItem("token", e.data.token); + }) + .catch((err) => console.log(err)); + }; + + return ( + + + + Sign in to your user account + + + + + + Email address + + + Password + + + + + Remember me + Forgot password? + + + + + + + + ); +} +export default UserLogin; diff --git a/frontend/src/Pages/Home/AdminRegister.jsx b/frontend/src/Pages/Signup/AdminRegister.jsx similarity index 100% rename from frontend/src/Pages/Home/AdminRegister.jsx rename to frontend/src/Pages/Signup/AdminRegister.jsx diff --git a/frontend/src/Pages/Home/UserRegister.jsx b/frontend/src/Pages/Signup/UserRegister.jsx similarity index 100% rename from frontend/src/Pages/Home/UserRegister.jsx rename to frontend/src/Pages/Signup/UserRegister.jsx diff --git a/frontend/src/Router/AllRoutes.jsx b/frontend/src/Router/AllRoutes.jsx index 6f40ee2..a7d34f1 100644 --- a/frontend/src/Router/AllRoutes.jsx +++ b/frontend/src/Router/AllRoutes.jsx @@ -1,10 +1,10 @@ import React from 'react' import { Route, Routes } from 'react-router-dom' import HomePage from '../Pages/Home/HomePage' -import AdminLogin from "../Pages/Home/AdminLogin" -import UserLogin from "../Pages/Home/UserLogin.jsx" -import AdminRegister from "../Pages/Home/AdminRegister.jsx" -import UserRegister from "../Pages/Home/UserRegister.jsx" +import AdminLogin from "../Pages/Login/AdminLogin" +import UserLogin from "../Pages/Login/UserLogin.jsx" +import AdminRegister from "../Pages/Signup/AdminRegister.jsx" +import UserRegister from "../Pages/Signup/UserRegister.jsx" diff --git a/frontend/src/index.js b/frontend/src/index.js index 56334b3..c1354d8 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -7,7 +7,8 @@ import {BrowserRouter} from "react-router-dom"; import { Provider } from "react-redux"; import { ChakraProvider } from '@chakra-ui/react' import { store } from './Store/store'; - +import 'mdb-react-ui-kit/dist/css/mdb.min.css'; +import "@fortawesome/fontawesome-free/css/all.min.css";