From b8e26333f284a6ce59668a3f5f43b24f017cdbe1 Mon Sep 17 00:00:00 2001 From: Pkpedram Date: Mon, 14 Feb 2022 12:45:17 +0330 Subject: [PATCH] Mobile top Menu Done --- src/assets/img/bag-2.svg | 6 ++ src/assets/img/home-2.svg | 4 +- src/assets/img/menu.svg | 5 ++ src/assets/img/profile.svg | 4 +- src/assets/img/task-square.svg | 10 +-- src/components/header/Header.js | 126 ++++++++++++++++++++------------ 6 files changed, 99 insertions(+), 56 deletions(-) create mode 100644 src/assets/img/bag-2.svg create mode 100644 src/assets/img/menu.svg diff --git a/src/assets/img/bag-2.svg b/src/assets/img/bag-2.svg new file mode 100644 index 0000000..54daa4c --- /dev/null +++ b/src/assets/img/bag-2.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/img/home-2.svg b/src/assets/img/home-2.svg index 97f345e..d55e8b2 100644 --- a/src/assets/img/home-2.svg +++ b/src/assets/img/home-2.svg @@ -1,4 +1,4 @@ - - + + diff --git a/src/assets/img/menu.svg b/src/assets/img/menu.svg new file mode 100644 index 0000000..794063e --- /dev/null +++ b/src/assets/img/menu.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/img/profile.svg b/src/assets/img/profile.svg index d60c1f4..a83fa62 100644 --- a/src/assets/img/profile.svg +++ b/src/assets/img/profile.svg @@ -1,4 +1,4 @@ - - + + diff --git a/src/assets/img/task-square.svg b/src/assets/img/task-square.svg index dacc1b9..eb1e8c6 100644 --- a/src/assets/img/task-square.svg +++ b/src/assets/img/task-square.svg @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/src/components/header/Header.js b/src/components/header/Header.js index aff9dc2..47a76e6 100644 --- a/src/components/header/Header.js +++ b/src/components/header/Header.js @@ -3,57 +3,84 @@ import searchIcon from "../../assets/img/Group 1148.svg"; import moment from "jalali-moment"; import { useState } from 'react'; import avatar1 from "../../assets/img/avatar/pexels-jan-kopřiva-3525908.jpg"; +import logoIcon from '../../assets/img/logo.png'; +import { connect } from 'react-redux'; -const Header=()=>{ + +const Header = ({ + isMobile +}) => { let today = moment().locale("fa").format("YYYY/M/D"); console.log("today:"); console.log(today); let weekday = new Date().getDay(); - let weekdayList=["یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه",'پنج‌شنبه','جمعه',"شنبه"]; + let weekdayList = ["یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", 'پنج‌شنبه', 'جمعه', "شنبه"]; console.log("weekday:"); console.log(weekday); return ( -
-
-
- avatar1 -
-
-
- کوروش زراندوز -
-
- صندوقدار -
-
-
-
-
- {/*
- - ساعت - - 11:11:11 -
*/} - -
- - {weekdayList[weekday]} - - - {today} - - - روز ملی صنعت نفت - -
-
-
+
+ + { + isMobile ? +
+
+ + + + + + +
+ +
+ + + + + + + +
+
: + <> +
+
+ avatar1 +
+
+
+ کوروش زراندوز +
+
+ صندوقدار +
+
+
+
+
+ + +
+ + {weekdayList[weekday]} + + + {today} + + + روز ملی صنعت نفت + +
+
+
+ + } + {/*
searchIcon { ); } +const mapStateToProps = (state) => ({ + isMobile: state.publicApi.isMobile, +}); +const mapDispatchToProps = { +}; -export default Header; +export default connect(mapStateToProps, mapDispatchToProps)(Header); -const Clock=()=>{ +const Clock = () => { let today = new Date(); let h = today.getHours(); let m = today.getMinutes(); @@ -80,11 +112,11 @@ const Clock=()=>{ // const [h,setH]=useState(today.getHours()); // const [m, setM] = useState(today.getMinutes()); // const [s, setS] = useState(today.getSeconds()); - const [counter,setCounter] = useState(0); + const [counter, setCounter] = useState(0); - setTimeout(()=>{ - setCounter(counter+1); - },1000); + setTimeout(() => { + setCounter(counter + 1); + }, 1000); return (