exam-header

main
alireza khaji 3 years ago
parent f173029298
commit 6c5afff160
  1. 19
      src/App.js
  2. 14
      src/view/Exam2/Exam.js
  3. 62
      src/view/Exam2/Header.js
  4. 9
      src/view/register/index.js

@ -43,6 +43,7 @@ import ChatPage from "./view/chatPage";
import ShoppingCart from "./components/ShoppingCart"; import ShoppingCart from "./components/ShoppingCart";
import MyServices from "./view/my-services/MyServices"; import MyServices from "./view/my-services/MyServices";
import MobileMyServices from "./view/my-services/mobile/MyServices"; import MobileMyServices from "./view/my-services/mobile/MyServices";
import Exam from "./view/Exam2/Exam";
let data = [ let data = [
{ {
@ -675,13 +676,19 @@ function App() {
setActiveUserFullInfo(false); setActiveUserFullInfo(false);
}; };
//------------------------------------
console.log("hhhhhhhh--------------------");
console.log(location.split("/"));
return ( return (
<Provider store={store}> <Provider store={store}>
<div> <div>
<Router> <Router>
<div className="App"> <div className="App">
{LOGIN && <Header logOut={logOut} />} {LOGIN && location?.split("/")[3] !== "exam" && (
{LOGIN && <Nav />} <Header logOut={logOut} />
)}
{LOGIN && location?.split("/")[3] !== "exam" && <Nav />}
<Routes> <Routes>
<Route <Route
path="/" path="/"
@ -704,7 +711,11 @@ function App() {
path="/myServices" path="/myServices"
element={ element={
LOGIN ? ( LOGIN ? (
window.innerWidth>1000 ?<MyServices /> : <MobileMyServices/> window.innerWidth > 1000 ? (
<MyServices />
) : (
<MobileMyServices />
)
) : ( ) : (
<LoginSignUp activeLogin={activeLogin} /> <LoginSignUp activeLogin={activeLogin} />
) )
@ -758,7 +769,7 @@ function App() {
<Route <Route
exact exact
path="/dashboard/azmoon_list/exam/:id" path="/dashboard/azmoon_list/exam/:id"
element={<EXAM />} element={<Exam />}
/> />
</> </>
) : ( ) : (

@ -0,0 +1,14 @@
import Header from "./Header";
const Exam=()=>{
return(
<div className="Exam px-28 pt-16 relative">
<Header/>
</div>
)
}
export default Exam;

@ -0,0 +1,62 @@
import { useState } from "react";
import { RiTimerLine } from "react-icons/ri";
const Header=()=>{
return (
<div className="Header w-full h-14 fixed top-2 left-0 px-28">
<div className="w-full h-full flex flex-row-reverse items-center justify-between rounded-lg border border-[#ECECEC] px-6">
<div
className="text-right text-sm text-right"
style={{ width: "calc(100% - 220px)" }}
>
آزمون تیزهوشان درس تاریخ باستان
</div>
<div className="w-52 flex items-center gap-x-2">
<div className="w-[30%]">
<Timer/>
</div>
<div className="text-sm" style={{direction:'rtl'}}>زمان باقیمانده :</div>
<RiTimerLine className="text-xl text-[#DF1452]" />
</div>
</div>
</div>
);
}
export default Header;
const Timer = ({ cellphone }) => {
const [min, setMin] = useState(10);
const [sec, setSec] = useState(30);
const [showBtn, setShowbtn] = useState(false);
setTimeout(() => {
if (sec === 0 && min === 0) {
setShowbtn(true);
}
if (sec === 0 && !showBtn) {
setSec(59);
setMin(min - 1);
} else {
setSec(sec - 1);
}
}, 1000);
return (
<>
{!showBtn && (
<div className="Code-container-send-code-again h-4/5 flex items-center justify-between">
<div className="w-[48%] text-sm text-center">{min}</div>
<div>:</div>
<div className="w-[48%] text-sm text-center">{sec}</div>
</div>
)}
{showBtn && (
<div className="Code-container-send-code-again mt-6 text-sm w-full text-center">
اتمام زمان
</div>
)}
</>
);
};

@ -394,30 +394,29 @@ const Register = ({
const [uploadImgNumber, setUploadImgNumber] = useState(0); const [uploadImgNumber, setUploadImgNumber] = useState(0);
const uploadImghandler1 = (e) => { const uploadImghandler1 = (e) => {
setFiles({ ...files, personalPic: e });
uploadImg({ uploadImg({
file: e, file: e,
}); });
setUploadImgNumber(1); setUploadImgNumber(1);
setFiles({ ...files, personalPic: e });
}; };
const uploadImghandler2 = (e) => { const uploadImghandler2 = (e) => {
setFiles({ ...files, shenasNameh: e }); setFiles({ ...files, shenasNameh: e });
console.log("fffffff:");
console.log(e);
uploadImg({ uploadImg({
file: e, file: e,
}); });
setUploadImgNumber(2); setUploadImgNumber(2);
}; };
useEffect(() => { useEffect(() => {
if (uploadImgNumber === 1) { if (uploadImgNumber === 1) {
setUserInfo({ ...userInfo, personalPicFileId: lastUploadId }); setUserInfo({ ...userInfo, personalPicFileId: lastUploadId });
} else if (uploadImgNumber === 2) { } else{
setUserInfo({ ...userInfo, shenasnamehFileId: lastUploadId }); setUserInfo({ ...userInfo, shenasnamehFileId: lastUploadId });
} }
}, [uploadImgNumber]); }, [uploadImgNumber,uploadLoading]);
const firstStepSubmit = () => { const firstStepSubmit = () => {
if (!userInfo.firstName && !userInfo.lastName) { if (!userInfo.firstName && !userInfo.lastName) {

Loading…
Cancel
Save