fixes styles and routes

This commit is contained in:
Николай Полтщук 2023-01-16 20:38:33 +03:00
parent f75510b20c
commit 50ab182135
9 changed files with 343 additions and 440 deletions

662
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,6 @@ const App = () => {
<Route index element={<Profile/>}/> <Route index element={<Profile/>}/>
<Route exact path='calendar' element={<ProfileCalendarPage/>}/> <Route exact path='calendar' element={<ProfileCalendarPage/>}/>
<Route exact path='summary' element={<Summary/>}/> <Route exact path='summary' element={<Summary/>}/>
<Route exact path='calendar' element={ProfileCalendarPage} />
</Route> </Route>
<Route path="*" element={<Navigate to="/" replace/>}/> <Route path="*" element={<Navigate to="/" replace/>}/>

View File

@ -57,7 +57,7 @@ export const ProfileCalendar = () => {
<img src={profileInfo.photo} className='summary__avatar' alt='avatar'/> <img src={profileInfo.photo} className='summary__avatar' alt='avatar'/>
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p> <p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
</div> </div>
<Link to='/profile/report'> <Link to='/report'>
<button className="calendar__btn">Заполнить отчет за день</button> <button className="calendar__btn">Заполнить отчет за день</button>
</Link> </Link>
</div> </div>

View File

@ -49,10 +49,10 @@ export const ProfileCalendarComponent = ({reportsDates}) => {
function correctRoute(day) { function correctRoute(day) {
for (const date of reportsDates) { for (const date of reportsDates) {
if (`${new Date(day).getFullYear()}-${correctDay(new Date(day).getMonth() + 1)}-${correctDay(new Date(day).getDate())}` === date.date) { if (`${new Date(day).getFullYear()}-${correctDay(new Date(day).getMonth() + 1)}-${correctDay(new Date(day).getDate())}` === date.date) {
return `/view/report` return `../../view/report`
} }
} }
return '/profile/report' return '../../report'
} }
// function prevMonth() { // function prevMonth() {
@ -104,7 +104,7 @@ export const ProfileCalendarComponent = ({reportsDates}) => {
name={day.format('dddd')} name={day.format('dddd')}
id='btn' id='btn'
> >
<Link to={() => correctRoute(day)}> <Link to={correctRoute(day)}>
<img className={'calendar__icon'} src={calendarIcon} alt='' /> <img className={'calendar__icon'} src={calendarIcon} alt='' />
{currentMonthAndDay(day)} {currentMonthAndDay(day)}
</Link> </Link>

View File

@ -53,11 +53,11 @@ export const ProfileHeader = () => {
<div className='profileHeader__info'> <div className='profileHeader__info'>
<div className='profileHeader__container'> <div className='profileHeader__container'>
<nav className='profileHeader__nav'> <nav className='profileHeader__nav'>
<NavLink to={'/summary'}>Резюме</NavLink> <NavLink end to={'/profile/summary'}>Резюме</NavLink>
<NavLink to={'/profile'}>Отчетность</NavLink> <NavLink end to={'/profile'}>Отчетность</NavLink>
<NavLink to={'/profile'}>Трекер</NavLink> <NavLink end to={'/'}>Трекер</NavLink>
<NavLink to={'/profile'}>Выплаты</NavLink> <NavLink end to={'/'}>Выплаты</NavLink>
<NavLink to={'/profile'}>Настройки</NavLink> <NavLink end to={'/'}>Настройки</NavLink>
</nav> </nav>
<div className='profileHeader__personalInfo'> <div className='profileHeader__personalInfo'>

View File

@ -51,7 +51,7 @@
} }
a { a {
text-decoration: none; text-decoration: none !important;
cursor: pointer; cursor: pointer;
font-weight: 700; font-weight: 700;
font-size: 18px; font-size: 18px;

View File

@ -79,7 +79,7 @@ const ReportForm = () => {
<h2 className='summary__title'>Ваши отчеты - <span>добавить отчет</span></h2> <h2 className='summary__title'>Ваши отчеты - <span>добавить отчет</span></h2>
<div> <div>
<div className='report__head'> <div className='report__head'>
<Link className='calendar__back' to={`/profile/profilecalendar`}> <Link className='calendar__back' to={`/profile/calendar`}>
<img src={arrow} alt=''/><p>Вернуться</p> <img src={arrow} alt=''/><p>Вернуться</p>
</Link> </Link>
</div> </div>

View File

@ -1,96 +0,0 @@
import React from 'react';
import {useSelector} from "react-redux";
import {getProfileInfo} from "../redux/outstaffingSlice";
import {ProfileHeader} from "../components/Profile/ProfileHeader";
import {Link} from "react-router-dom";
import {Footer} from "../components/Footer/Footer";
import reportsIcon from "../images/reports.png"
import summaryIcon from "../images/summaryIcon.png"
import timerIcon from "../images/timerIcon.png"
import paymentIcon from "../images/paymentIcon.png"
import settingIcon from "../images/settingIcon.png"
import rightArrow from "../images/arrowRight.png"
import '../components/Profile/profile.scss'
export const Profile = () => {
const profileInfo = useSelector(getProfileInfo);
return(
<div className='profile'>
<ProfileHeader/>
<div className='container'>
<h2 className='profile__title'>Добрый день, <span>{profileInfo.fio}</span></h2>
<div className='summary__info'>
<div className='summary__person'>
<img src={profileInfo.photo} className='summary__avatar' alt='avatar'/>
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
</div>
</div>
<div className='profile__items'>
<Link to={'/profile/profilecalendar'} className='item'>
<div className='item__about'>
<img src={reportsIcon} alt='report'/>
<h3>Ваша отчетность</h3>
</div>
<div className='item__info'>
<p><span></span>Отработанных в этом месяце часов</p>
<div className='item__infoLink'>
<img src={rightArrow} alt='arrow'/>
</div>
</div>
</Link>
<Link to={'/summary'} className='item'>
<div className='item__about'>
<img src={summaryIcon} alt='summary'/>
<h3>Данные и резюме</h3>
</div>
<div className='item__info'>
<p>Ваше резюме<br/><span>заполнено</span></p>
<div className='item__infoLink'>
<img src={rightArrow} alt='arrow'/>
</div>
</div>
</Link>
<Link to={'/profile'} className='item'>
<div className='item__about'>
<img src={timerIcon} alt='timer'/>
<h3>Трекер времени</h3>
</div>
<div className='item__info'>
<p>Сколько времени занимает<br/> выполнение задач</p>
<div className='item__infoLink'>
<img src={rightArrow} alt='arrow'/>
</div>
</div>
</Link>
<Link to={'/profile'} className='item'>
<div className='item__about'>
<img src={paymentIcon} alt='payment'/>
<h3>Выплаты</h3>
</div>
<div className='item__info'>
<p>У вас <span>подтвержден</span><br/> статус самозанятого</p>
<div className='item__infoLink'>
<img src={rightArrow} alt='arrow'/>
</div>
</div>
</Link>
<Link to={'/profile'} className='item'>
<div className='item__about'>
<img src={settingIcon} alt='settings'/>
<h3>Настройки аккаунта</h3>
</div>
<div className='item__info'>
<p>Перейдите чтобы начать<br/> редактирование</p>
<div className='item__infoLink'>
<img src={rightArrow} alt='arrow'/>
</div>
</div>
</Link>
</div>
</div>
<Footer/>
</div>
)
};

View File

@ -38,7 +38,7 @@ export const Profile = () => {
<h3>Ваша отчетность</h3> <h3>Ваша отчетность</h3>
</div> </div>
<div className='item__info'> <div className='item__info'>
<p><span>У вас 122 часа</span><br/> отработанных в этом месяце</p> <p><span></span>Отработанных в этом месяце часов</p>
<div className='item__infoLink'> <div className='item__infoLink'>
<img src={rightArrow} alt='arrow'/> <img src={rightArrow} alt='arrow'/>
</div> </div>