Add Cards in Profile

This commit is contained in:
Никита Губарь 2024-04-22 16:19:40 +03:00
parent 1bdabd32bf
commit bd4bfacd66
5 changed files with 44 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

View File

@ -10,7 +10,7 @@ export const CardControl = ({ title, path, description, img }) => {
<Link to={`/${path}`} className="control-card"> <Link to={`/${path}`} className="control-card">
<div className="control-card__about"> <div className="control-card__about">
<img src={img} alt="itemImg" /> <img src={img} alt="itemImg" />
<h3>{title}</h3> <h3 dangerouslySetInnerHTML={{ __html: title }}></h3>
</div> </div>
<div className="control-card__info"> <div className="control-card__info">
<p dangerouslySetInnerHTML={{ __html: description }}></p> <p dangerouslySetInnerHTML={{ __html: description }}></p>

View File

@ -38,7 +38,7 @@
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
line-height: 22px; line-height: 22px;
max-width: 125px; max-width: 165px;
margin-bottom: 0; margin-bottom: 0;
} }
} }

View File

@ -46,6 +46,7 @@ export const ProfileCalendarComponent = React.memo(
}) => { }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const [l, setL] = useState(1);
const [calendar, setCalendar] = useState([]); const [calendar, setCalendar] = useState([]);
const [month, setMonth] = useState(""); const [month, setMonth] = useState("");
const [endDate, setEndDate] = useState(null); const [endDate, setEndDate] = useState(null);
@ -174,9 +175,27 @@ export const ProfileCalendarComponent = React.memo(
}); });
} }
// function errorr(TotalRangeHours) { // function dddd(day) {
// console.error(TotalRangeHours); // let index = day.format("D") - l;
// console.log(`d ${day.format("d")}`);
// if (day.format("d") != 0 && day.format("d") != 6) {
// let elementAtIndex1 = reports[index];
// if (elementAtIndex1 && elementAtIndex1.task) {
// let totalHoursSpent = elementAtIndex1.task.reduce(
// (total, task) => total + task.hours_spent,
// 0
// );
// console.log(`index ${index}`);
// console.log(elementAtIndex1);
// console.log(`h ${totalHoursSpent}`);
// return totalHoursSpent;
// }
// } else {
// setL(l + 1);
// console.log(`l ${l}`);
// }
// } // }
return ( return (
<div className="calendar-component"> <div className="calendar-component">
<div className="calendar-component__header"> <div className="calendar-component__header">
@ -265,7 +284,7 @@ export const ProfileCalendarComponent = React.memo(
<div className="form-date">{day.format("D")}</div> <div className="form-date">{day.format("D")}</div>
<div className="form-box"> <div className="form-box">
<div className="form-hours"> <div className="form-hours">
<span>7/Час</span> <span>7/</span>
</div> </div>
</div> </div>
{/* {currentMonthAndDay(day)} */} {/* {currentMonthAndDay(day)} */}

View File

@ -11,7 +11,8 @@ import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
// import paymentIcon from "assets/icons/paymentIcon.png"; import financeIcon from "assets/icons/financeIcon.png";
import paymentIcon from "assets/icons/paymentIcon.png";
import settingIcon from "assets/icons/settingIcon.png"; import settingIcon from "assets/icons/settingIcon.png";
import summaryIcon from "assets/icons/summaryIcon.png"; import summaryIcon from "assets/icons/summaryIcon.png";
import timerIcon from "assets/icons/timerIcon.png"; import timerIcon from "assets/icons/timerIcon.png";
@ -28,10 +29,10 @@ export const Profile = () => {
const [profileItemsInfo] = useState({ const [profileItemsInfo] = useState({
developer: [ developer: [
{ {
path: "profile/calendar", path: "profile",
img: reportsIcon, img: paymentIcon,
title: "Ваша отчетность", title: "Работа в IT <br/>открытые запросы",
description: "<span></span>Отработанных в этом месяце часов" description: "Перейдите чтобы посмотреть <br/>открытые позиции"
}, },
{ {
path: "profile/summary", path: "profile/summary",
@ -42,20 +43,26 @@ export const Profile = () => {
{ {
path: "profile/tracker", path: "profile/tracker",
img: timerIcon, img: timerIcon,
title: "Трекер времени", title: "Трекер <br/>времени",
description: "Сколько времени занимает <br/>выполнение задач" description: "Сколько времени занимает <br/>выполнение задач"
}, },
// { {
// path: "profile/payouts", path: "profile/payouts",
// img: paymentIcon, img: financeIcon,
// title: "Выплаты", title: "Выплаты и <br/>финансы",
// description: "У вас <span>подтвержден</span> <br/>статус самозанятого" description: "У вас <span>подтвержден</span> <br/>статус самозанятого"
// }, },
{ {
path: "profile/settings", path: "profile/settings",
img: settingIcon, img: settingIcon,
title: "Настройки профиля", title: "Настройки <br/>профиля",
description: "Перейдите чтобы начать <br/>редактирование" description: "Перейдите чтобы начать <br/>редактирование"
},
{
path: "profile/calendar",
img: reportsIcon,
title: "Ваша <br/>отчетность",
description: "<span></span>Отработанных в этом месяце часов"
} }
], ],
partner: [ partner: [