Calendar Fixed

main
Pedram Keshavarzi 3 years ago
parent 11c7c34fdf
commit 35875fda6c
  1. 2
      src/App.js
  2. 12
      src/components/Calendar/CalendarComponents/Calendar.js
  3. 27
      src/components/Calendar/CalendarComponents/components/DaysList.js
  4. 4
      src/components/Calendar/CalendarComponents/components/Header.js
  5. 37
      src/components/Calendar/index.css
  6. 20
      src/components/Calendar/index.js
  7. 16
      src/components/Product/index.js
  8. 8
      src/components/exam/Carousel/index.css
  9. 4
      src/components/header/Header.js
  10. 6
      src/components/nav/Nav.js
  11. 151
      src/redux/reducers/book.js
  12. 16
      src/redux/reducers/user.js
  13. 6
      src/view/contact/index.js
  14. 52
      src/view/dashboard/Dashboard.js
  15. 24
      src/view/dashboard/cal.css
  16. 12
      src/view/services/index.js

@ -669,7 +669,7 @@ function App() {
{LOGIN && <Header logOut={logOut} />}
{LOGIN && <Nav logOut={logOut} />}
<Routes>
<Route path="/" element={LOGIN ?
<Route path="/myServices" element={LOGIN ?
<Dashboard
ActiveUserFullInfo={ActiveUserFullInfo}
UserFullInfoData={UserFullInfoData}

@ -253,10 +253,10 @@ let active_list;
<div className="dbp1-month">{month}</div>،
<div className="dbp1-year">{year}</div>
</div>
<div className="date-box-p1-time">
{/* <div className="date-box-p1-time">
<Clock />
</div>
</div> */}
</div>
<MonthSelector
@ -309,14 +309,16 @@ let active_list;
type={type}
/>
<div className="Calendar__footer">
{/* <div className={`footer__Events ${type}`}>
{ eventInFooter !== null && eventInFooter !== undefined &&
<div className={`footer__Events ${type}`}>
{
type == 'dashboard' ? <><div className='text-xl font-black text-blue-400'>رویداد ها: </div><p className='text-blue-300 font-bold'>{eventInFooter ? eventInFooter : 'رویدادی در این روز وجود ندارد!'}</p></> : eventInFooter
type == 'dashboard' ? <><div className='text-xl font-black text-red52'>رویداد ها: </div><p className='text-red26 font-bold'>{eventInFooter ? eventInFooter : 'رویدادی در این روز وجود ندارد!'}</p></> : eventInFooter
}
</div>
{renderFooter()} */}
}
{renderFooter()}
</div>
</div>
);

@ -257,16 +257,24 @@ const DaysList = ({
isStandard,
});
// showing Dots Of Events
// showing Dots Of Events
const specialDate = (sDay, sMonth, sYear) => {
return events.map((e) => {
let hasEvents = events.find(itm => sDay == itm.day && sMonth == itm.month && sYear == itm.year);
console.log(hasEvents);
if (hasEvents !== undefined && hasEvents !== null ){
return <span> {events.map((e) => {
if (sDay == e.day && sMonth == e.month && sYear == e.year) {
return <span key={'dot' + e.id} style={{
color: e.color
}}>.</span>;
return(
<svg height="5" key={'dot' + e.id} width="5">
<circle cx="2.5" cy="2.5" r="2" stroke-width="3" fill="red" />
</svg>) ;
}
})
})}</span>
}
};
@ -299,6 +307,7 @@ const DaysList = ({
// console.log(specialDate(day));
// console.log(showEventDescription(day))
showEvent(showEventDescription(day, month, year))
// console.log(showEventDescription(day, month, year))
}}
onKeyDown={({ key }) => {
@ -316,9 +325,9 @@ const DaysList = ({
role="gridcell"
data-is-default-selectable={shouldEnableKeyboardNavigation}
>
<p className=''>{!isStandard ? '' : getLanguageDigits(day)}</p>
{/* Dots Of Events */}
<span>{specialDate(day, month, year)}</span>
<span className=''>{!isStandard ? '' : getLanguageDigits(day)}</span>
{/* Dots Of Events */}
{specialDate(day, month, year)}
</div>
);
};

@ -44,8 +44,8 @@ const Header = ({
const monthText = headerElement.current.querySelector(
'.Calendar__monthYear.-shown .Calendar__monthText',
);
const yearText = monthText.nextSibling;
const hasActiveBackground = element => element.classList.contains('-activeBackground');
const yearText = monthText?.nextSibling;
const hasActiveBackground = element => element?.classList.contains('-activeBackground');
const isInitialRender =
!isOpen && !hasActiveBackground(monthText) && !hasActiveBackground(yearText);
if (isInitialRender) return;

@ -590,8 +590,9 @@
.Calendar__day.dashboard {
width: calc(100% / 7 - 6px);
text-align: center;
padding: calc(0.25em - 1px);
font-size: 1.6em;
height:40px;
/* padding: calc(0.25em - 1px); */
/* font-size: 1.6em; */
border-radius: 7px;
transition: 0.2s;
border: 1px solid transparent;
@ -599,7 +600,7 @@
color: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
vertical-align: middle;
background-color: transparent;
@ -607,32 +608,37 @@
}
.Calendar__day span{
padding: -10px;
margin-top: -30px;
font-size: 28px;
padding: 0px;
/* margin-top: -30px; */
margin: 0px;
display: flex;
justify-content: center;
height: 100%;
align-items: center;
/* font-size: 28px; */
}
.Calendar__day:focus {
outline: 1px dashed rgba(0, 0, 0, 0.4);
/* outline: 1px dashed rgba(0, 0, 0, 0.4); */
outline-offset: 2px;
}
.Calendar__day.-ltr {
min-height: 2.6em;
/* min-height: 2.6em; */
font-size: 1.45em;
}
.Calendar__day.-rtl {
font-size: 1.55em;
height: 40px;
/* height: 35px; */
}
.Calendar__day:not(.-blank):not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween):not(.-selected):hover {
background-color: rgba(223, 20, 82, 0.06);
color: #df1452;
border:1px solid #df1452;
/* border:1px solid #df1452; */
}
.Calendar__day.-selected,
@ -689,13 +695,12 @@
}
.Calendar__day.-today:not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween) {
font-weight: 600;
color: var(--cl-color-black);
color: #000;
position: relative;
background-color: rgba(223, 20, 82, 0.06);
color: #df1452;
/* border:1px solid #df1452; */
}
.Calendar__day.-today:not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween)::after {
/* .Calendar__day.-today:not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween)::after {
content: '';
position: absolute;
bottom: 0.2em;
@ -707,7 +712,7 @@
opacity: 0.5;
transform: translateX(-50%);
transition: 0.2s;
}
} */
.Calendar__day.-today:hover:not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween)::after {
opacity: 0;

@ -74,8 +74,8 @@ const eventsList = [
type: "global",
isHoliday: true,
date: "2022-01-12T00:00:00.000Z",
year: 1400,
month: 10,
year: 1401,
month: 1,
day: 1
},
{
@ -85,9 +85,9 @@ const eventsList = [
userId: "5",
date: "2022-01-12T00:00:00.000Z",
categoryId: 1,
year: 1400,
month: 10,
day: 3,
year: 1401,
month: 1,
day: 15,
color: 'blue'
},
{
@ -97,9 +97,9 @@ const eventsList = [
userId: "5",
date: "2022-01-08T00:00:00.000Z",
categoryId: 3,
year: 1400,
month: 11,
day: 6
year: 1401,
month: 1,
day: 3
},
{
id: 5,
@ -108,8 +108,8 @@ const eventsList = [
userId: "5",
date: "2022-01-12T00:00:00.000Z",
categoryId: 1,
year: 1400,
month: 10,
year: 1401,
month: 1,
day: 3
}
];

@ -77,7 +77,7 @@ const ProductDesign = ({
if (catId == 1) {
return (
<div className={`flex flex-col pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
<div className={`flex flex-col cursor-pointer pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px' , direction: 'rtl' }}
onClick={onClick}
>
@ -104,7 +104,7 @@ const ProductDesign = ({
<div className="flex p-4 justify-between items-center">
<h1 className="font-black text-xl text-red52">{productPrice} تومان</h1>
<div
className={`bg-pinkF5 text-red26 w-32 border-2 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
className={`bg-pinkF5 text-red26 rounded-md w-32 border-2 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
`}
>
<button className="z-3" onClick={btnOnClick}>افزودن به سبد خرید</button>
@ -121,7 +121,7 @@ const ProductDesign = ({
}
if (catId == 2) {
return (
<div className="w-full flex justify-center">
<div className="w-full flex justify-center">
<div className={`flex ${isMobile ? 'flex-col w-11/12 border-red52' : 'border-red82OP pt-4'} border my-4 rounded-lg `} style={{width: !isMobile && '90%' }}>
<div className={` ${isMobile ? 'w-full h-24 ' : 'w-60 p-4 flex items-center justify-center' }`}>
{/* image */}
@ -173,7 +173,7 @@ const ProductDesign = ({
<div className={`flex px-4 ${isMobile ? 'w-full border-red82OP border-t' : 'w-2/5 py-4'} justify-between items-center`}>
<h1 className={`${isMobile && 'w-1/2 h-full flex items-center py-4 border-l border-red82OP'} font-black text-xl text-red52`}>{productPrice} تومان</h1>
<div
className={`bg-pinkF5 text-red26 w-32 border-2 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
className={`bg-pinkF5 rounded-md text-red26 w-32 border-2 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
`}
>
<button onClick={btnOnClick}> رزرو پیش ثبت نام </button>
@ -190,7 +190,7 @@ const ProductDesign = ({
}
if(catId == 3){
return(
<div className={`flex flex-col pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
<div className={`flex cursor-pointer flex-col pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px', direction: 'rtl' }}
>
@ -233,7 +233,7 @@ const ProductDesign = ({
<div className="flex p-4 justify-between items-center">
<h1 className="font-black text-xl text-red52">{productPrice} تومان</h1>
<div
className={`bg-pinkF5 text-red26 w-32 border-2 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
className={`bg-pinkF5 text-red26 w-32 border-2 rounded-md border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
`}
>
<button onClick={btnOnClick}>افزودن به سبد خرید</button>
@ -249,7 +249,7 @@ const ProductDesign = ({
}
if(catId == 4){
return (
<div className={`flex flex-col text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
<div className={`flex flex-col cursor-pointer text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px', direction: 'rtl' }}
>
@ -270,7 +270,7 @@ const ProductDesign = ({
<h1 className={`font-black text-xl py-4 text-red52 ${isMobile && 'w-1/2 border-l border-red82OP text-center'}`}>{productPrice} تومان</h1>
<div
className={`bg-${isMobile ? 'blueFF border-blueDF rounded-lg py-3' : 'pinkF5 border-red52 py-2'} text-red26 w-32 border-2 px-1 text-xs flex justify-center hover:bg-red52 hover:text-white
className={`bg-${isMobile ? 'blueFF border-blueDF rounded-lg py-3' : 'pinkF5 border-red52 py-2'} rounded-md text-red26 w-32 border-2 px-1 text-xs flex justify-center hover:bg-red52 hover:text-white
`}
>
<button onClick={btnOnClick}>افزودن به سبد خرید</button>

@ -90,7 +90,7 @@
}
.melc-content-item{
/* width: 100%; */
width: 100%;
/* height: 280px; */
margin: 30px 0;
/* margin-top: 30px; */
@ -99,7 +99,7 @@
position: absolute;
top: 0;
right: 0;
transition: all 0.6s ease;
transition: all 0.1s ease;
}
.melc-content-item-more{
@ -181,7 +181,7 @@
right: 0;
transform: scaleY(0);
transform-origin: bottom;
transition: all 0.5s ease;
transition: all 0.1s ease;
}
.melc-c-i-item-info{
@ -256,7 +256,7 @@
transform: translateY(140px);
overflow: hidden;
text-overflow: ellipsis;
transition: all 0.5s ease;
transition: all 0.1s ease;
/* margin-top: 10px;
margin-bottom: 5px; */

@ -42,8 +42,8 @@ const Header = ({
<Link to='/adminpanel/add-exam' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
ورود به صفحه افزودن آزمون
</Link>
<Link to='/adminpanel/add-product' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
ورود به صفحه افزودن محصول
<Link to='/register' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
افزودن حساب کاربری جدید
</Link>
</div>
}

@ -326,7 +326,7 @@ useEffect(() => {
<Link
to="/settings"
to="/myServices"
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={() => chaneNav(3)}
>
@ -399,7 +399,7 @@ useEffect(() => {
className="nav-menu-container-item-title text-sm"
style={4 === navId ? { color: "#fff" } : { color: "#A5A8AB" }}
>
پشتیبانی
چت با اساتید
</div>
</Link>
{/* ---------- */}
@ -427,7 +427,7 @@ useEffect(() => {
className="nav-menu-container-item-title text-sm"
style={5 === navId ? { color: "#fff" } : { color: "#A5A8AB" }}
>
اطلاعات تماس
پشتیبانی
</div>
</Link>

@ -3,7 +3,156 @@ import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: [],
list: [
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
{
id:1,
name: 'عربی دوازدهم',
price: 1000000,
vodTeacher: 'علی عبدالمالکی'
},
],
info: null,
searchResult: [],
filterResult: [],

@ -2,7 +2,21 @@ import proxy from "../proxy";
import { toast } from "react-toastify";
const initialState = {
status: proxy.status(),
status: {
name:'کوروش',
lastName: 'زراندوز',
roles: [],
rolesString: [
{
id:1,
roleName: 'پایه ششم',
},
{
id:2,
roleName: 'مدیر',
},
]
},
loading: false,
error: null,
list: null,

@ -120,6 +120,12 @@ const ContactUs = ({isMobile}) => {
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<select className="bg-white border border-solid border-gray-200 w-full my-4 mt-0 p-3 rounded-lg text-gray-400 outline-red52">
<option>انتخاب محصول / خدمات</option>
{departments.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea>

@ -12,7 +12,10 @@ import SimpleCalendar from '../../components/Calendar'
import MobileHome from "./mobile";
import { connect } from "react-redux";
import { publicApi } from "../../redux/actions";
// import { Calendar } from "react-multi-date-picker"
// import persian from "react-date-object/calendars/persian"
// import persian_fa from "react-date-object/locales/persian_fa"
import './cal.css';
const Dashboard = ({
ActiveUserFullInfo,
@ -48,7 +51,50 @@ const Dashboard = ({
/> */}
<div className="w-full mb-4">
<SimpleCalendar />
{/* <Calendar
calendar={persian}
locale={persian_fa}
className="custom-calendar red"
showOtherDays
format="YYYY/MM/dddd"
weekDays={['شنبه', 'یک شنبه', 'دو شنبه', 'سه شنبه' , 'چهار شنبه', 'پنج شنبه', 'جمعه']}
mapDays={({ date }) => {
let thisEvent;
if ([4, 5, 6, 7].includes(date.day)) {thisEvent = false}
if([{
day: 4,
event: 'جشن',
},
{
day: 8,
event: 'شادی',
},
{
day: 12,
event: 'پایکوبی',
},
{
day: 21,
event: 'خنده',
},
].filter(itm => itm.day)){
thisEvent = true
console.log('a+')
}
if (thisEvent == false) return {
className: "highlight border-solid border-b border-red-500 rounded-md",
// onClick: () => setEvents()
}
}}
>
</Calendar> */}
<SimpleCalendar />
</div>
@ -60,7 +106,7 @@ const Dashboard = ({
<div className="dashboard-right-part-row2 w-full mt-4 flex items-start justify-between flex-row-reverse">
<LastActivity />
{/* {ActiveUserFullInfo && (
{/* {ActiveUserFullInfo && (b
<div className="dashboard-blur-box w-full h-full absolute top-0 left-0 backdrop-blur z-40">
<UserFullInfo
buyBtn={true}

@ -0,0 +1,24 @@
.custom-calendar .rmdp-top-class,
.custom-calendar .rmdp-calendar > div:not(:first-child),
.custom-calendar .rmdp-day-picker {
width:100%;
padding: 1%;
/* height: 100%; */
}
.custom-calendar,
.custom-calendar .rmdp-calendar,
.custom-calendar .rmdp-day-picker > div {
width: 100%;
height: 100%;
}
.custom-calendar .rmdp-day {
width: unset;
flex: 1;
}
.custom-calendar .rmdp-week {
height: 14.5%;
}

@ -319,19 +319,19 @@ if (!isMobile){
} items-center w-full justify-center flex-wrap `}
>
{books?.map((product, index) => (
<Link
<div
// to={"/class/" + product?.id}
to="#"
key={`PRODUCT__${gameId}__${index}`}
onClick={() => {
setPopUpContent({
id: gameId,
title: product?.name,
video: "",
teacher: product.vodTeacher,
teacher: product?.vodTeacher,
description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: product.product[0].price,
price: product?.price,
classHour: 21,
classMinute: 56,
image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg',
@ -374,7 +374,7 @@ if (!isMobile){
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={product.product[0].price}
productPrice={product?.price}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
@ -394,7 +394,7 @@ if (!isMobile){
}
}
/>
</Link>
</div>
))}
{
gameId == 6 &&

Loading…
Cancel
Save