Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Июль-2 #147

Merged
merged 55 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d519261
fix: fix Login page
bevuxyna Jun 15, 2023
2b9609b
fix: fix Password input
bevuxyna Jun 15, 2023
0fc6cd1
fix: fix Input
bevuxyna Jun 15, 2023
06e3ccf
fix: validate inputs after user leaves the input
bevuxyna Jun 17, 2023
32efd3c
fix: fix NewPassword page
bevuxyna Jun 19, 2023
9af6e75
UMAK-201: Длинный пароль перекрывает иконку глаза на странице Регистр…
bevuxyna Jun 21, 2023
bce3e10
UMAK-204: Кнопка Зарегистрироваться становится активна, если в поле П…
bevuxyna Jun 21, 2023
690e211
UMAK-203: Не появляется ошибка если ввести значение без букв в поле И…
bevuxyna Jun 21, 2023
87819a9
UMAK-203: fix regex
bevuxyna Jun 21, 2023
c158989
UMAK-195: Добавить крестик на popup
bevuxyna Jun 22, 2023
7d62fe4
UMAK-194: Закрытие popup по клику вне области popup
bevuxyna Jun 22, 2023
3e08fe4
fix: fix update user info
bevuxyna Jun 28, 2023
56d887e
fix
bevuxyna Jun 29, 2023
47d5568
fix: off camelcase rule
bevuxyna Jun 29, 2023
f4ceb0a
fix: fix after PR
bevuxyna Jun 30, 2023
007359c
fix: fix after review
bevuxyna Jul 1, 2023
e004cd3
fix: change user profile depend on status
bevuxyna Jul 1, 2023
1ceac89
Merge branch 'dev' into fix/profile
bevuxyna Jul 1, 2023
6709b84
fix: fix after review
bevuxyna Jul 2, 2023
231f8ac
fix: fix InfoToolTip
bevuxyna Jul 2, 2023
a7c2828
feat: add emailConfirmationTemplate
bevuxyna Jul 4, 2023
54b103b
fix: fix font
bevuxyna Jul 6, 2023
d61c85c
refactor(App): setting the ProtectedRoute component
Artyom774 Jul 7, 2023
53a0ebd
feat: add PrivacyPolicyPage (#132)
ponomareva-frontend Jul 11, 2023
e506a95
feat: add displaying SheltersList according to the shelter warning co…
ponomareva-frontend Jul 13, 2023
f22df35
feat: add a table to PrivacyPolicyPage (#137)
ponomareva-frontend Jul 13, 2023
639f378
Merge branch 'dev' into fix/infotooltip
bevuxyna Jul 13, 2023
8b2031e
fix: close InfoTooltip after 15 seconds
bevuxyna Jul 13, 2023
6c8a134
fix: fix standard font's weight
bevuxyna Jul 13, 2023
430cf52
fix
bevuxyna Jul 13, 2023
5e56bac
Merge pull request #131 from Lapkipomoshi/fix/infotooltip
bevuxyna Jul 13, 2023
ea59ed3
feat: add template for email confirmation
bevuxyna Jul 13, 2023
de480f1
feat: add template for success registration
bevuxyna Jul 16, 2023
1a88b2b
fix styles
bevuxyna Jul 16, 2023
a68c8ba
feat: add template for reset password
bevuxyna Jul 16, 2023
be64cb8
feat: add template for change email
bevuxyna Jul 16, 2023
28031d0
fix text
bevuxyna Jul 16, 2023
c318f0f
feat: add template for change password
bevuxyna Jul 16, 2023
2ffee4b
fix styles
bevuxyna Jul 16, 2023
6c6c956
Merge branch 'dev' into fix/profile
bevuxyna Jul 16, 2023
660a042
fix profile popup
bevuxyna Jul 16, 2023
7e0bb61
fix: change validation on onChange
bevuxyna Jul 16, 2023
ba2b54e
fix: change autocomplete background-color
bevuxyna Jul 16, 2023
8653c78
feat(App): add app with the site data
Artyom774 Jul 11, 2023
fb8a89c
fix after review
bevuxyna Jul 16, 2023
b571e60
fix after W3C validation
bevuxyna Jul 16, 2023
64c62e0
Merge pull request #145 from Lapkipomoshi/fix/profile
bevuxyna Jul 17, 2023
63e13a6
Merge pull request #141 from Lapkipomoshi/email_template
bevuxyna Jul 17, 2023
d05495e
feat: add scroll to slider (#143)
ponomareva-frontend Jul 18, 2023
a59fa12
feat: add new filter to shelters list page (#144)
ponomareva-frontend Jul 18, 2023
40c9946
Merge branch 'dev' into refactor/ProtectedRoute
Artyom774 Jul 18, 2023
c429910
Update conflicts App.jsx
Artyom774 Jul 18, 2023
a27ff2b
Merge pull request #135 from Lapkipomoshi/refactor/ProtectedRoute
Artyom774 Jul 18, 2023
011fc19
feat: add terms page (#142)
ponomareva-frontend Jul 19, 2023
2c480a6
feat: add links (#146)
ponomareva-frontend Jul 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
"class-methods-use-this": "warn",
"prefer-promise-reject-errors": "warn",
"react/jsx-one-expression-per-line": "off",
"react/destructuring-assignment": "off",
"no-unused-expressions": "warn",
"camelcase": [1, { "properties": "never" }]
}
}
4 changes: 0 additions & 4 deletions src/components/CardsSlider/CardsSlider.css

This file was deleted.

34 changes: 13 additions & 21 deletions src/components/CardsSlider/CardsSlider.jsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
import React, { useRef } from 'react';
import './CardsSlider.css';
import './CardsSlider.scss';

const CardsSlider = ({
children, listLength, columnGap = 24, cardWidth = 200,
}) => {
const slider = useRef(null); // элемент слайдера
const CardsSlider = ({ children, isButtonsHidden = false }) => {
const defaultScrollPixelsAmount = 350;

let position = 0; // смещение карточек в слайдере при листании
const sliderContainerRef = useRef(null);

const handlePrev = () => { // показать предыдущие карточки
if (position < 0) position += 200;
slider.current.childNodes.forEach((element) => {
element.style = `transform: translateX(${position}px)`;
});
};
const handleSliderScroll = (direction) => {
return () => {
const scrollPixelsAmount = direction === 'left' ? -defaultScrollPixelsAmount : defaultScrollPixelsAmount;

const handleNext = () => { // показать следующие карточки
if (position >= (-(listLength - 7) * (columnGap + cardWidth))) position -= (columnGap + cardWidth);
slider.current.childNodes.forEach((element) => {
element.style = `transform: translateX(${position}px)`;
});
sliderContainerRef.current.scrollBy({ behavior: 'smooth', left: scrollPixelsAmount });
};
};

return (
<>
<ul className='cards-slider' ref={slider} style={{ columnGap: `${columnGap}px` }}>
<ul className='cards-slider' ref={sliderContainerRef}>
{children}
</ul>
<div className='cards-slider__buttons'>
<button className='cards-slider__button' type='button' onClick={handlePrev} />
<button className='cards-slider__button cards-slider__button_next' type='button' onClick={handleNext} />
<div className={`cards-slider__buttons ${isButtonsHidden && 'cards-slider__buttons_hidden'}`}>
<button className='cards-slider__button' type='button' onClick={handleSliderScroll('left')} />
<button className='cards-slider__button cards-slider__button_next' type='button' onClick={handleSliderScroll('right')} />
</div>
</>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/CardsSlider/CardsSlider.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import url('./styles/cards-slider.scss');
@import url('./styles/__buttons/cards-slider__buttons.scss');
@import url('./styles/__button/cards-slider__button.scss');
@import url('./styles/__button/_next/cards-slider__button_next.scss');
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
width: 49px;
height: 49px;
margin: 0 9px 0 0;
background-color: rgba(0,0,0,0);
background-color: rgba(0, 0, 0, 0);
background-image: url('../../../../images/slider__button.svg');
background-position: center;
background-size: 41px;
background-repeat: no-repeat;
border: none;
cursor: pointer;
transition-duration: .7s;
}
transition-duration: 0.7s;

.cards-slider__button:hover {
opacity: .77;
&:hover {
opacity: 0.77;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.cards-slider__buttons {
margin-bottom: 40px;

&_hidden {
display: none;
}

@media (min-width: 768px) {
margin-bottom: 80px;
}
}
7 changes: 0 additions & 7 deletions src/components/CardsSlider/styles/cards-slider.css

This file was deleted.

20 changes: 20 additions & 0 deletions src/components/CardsSlider/styles/cards-slider.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.cards-slider {
margin: 0;
display: flex;
white-space: nowrap;
overflow-y: hidden;
width: 100%;
padding: 0 16px;
box-sizing: border-box;
list-style-type: none;
column-gap: 38px;
overflow: hidden;

@media (min-width: 768px) {
padding: 20px 0 44px 44px;
}

@media (min-width: 1440px) {
padding-left: 132px;
}
}
8 changes: 3 additions & 5 deletions src/components/DetailsCard/DetailsCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import './DetailsCard.css';
import PlusMinus from './svg/PlusMinus';
import Arrow from './svg/Arrow';

const DetailsCard = ({
children, title, isOpen, textStyle = 'faq', iconType = 'plus-minus',
}) => {
const DetailsCard = ({ children, title, isOpen, iconType, titleClasses }) => {
return (
<details className='details-card' open={isOpen}>
<summary className={`details-card__summary details-card__summary_style_${textStyle}`}>
<p className={`details-card__title details-card__title_style_${textStyle}`}>{title}</p>
<summary className='details-card__summary'>
<p className={`details-card__title ${titleClasses}`}>{title}</p>
{iconType === 'plus-minus' && <PlusMinus />}
{iconType === 'arrow' && <Arrow />}
</summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
.details-card__summary {
display: flex;
width: 100%;
padding: 24px 28px 20px 40px;
justify-content: space-between;
align-items: center;
background-color: var(--color-background-additional);
cursor: pointer;
box-sizing: border-box;
}

.details-card__summary_style_shelter-pets {
margin-left: 132px;
border-radius: 20px;
transition-duration: .5s;
}

.shelter-pets__summary_style_shelter-pets:hover {
opacity: .77;
}
12 changes: 0 additions & 12 deletions src/components/DetailsCard/styles/__title/details-card__title.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
.details-card__title {
width: 890px;
margin: 0;
padding: 0;
font-size: 24px;
line-height: 29px;
}

.details-card__title_style_faq {
font-weight: 500;
font-family: var(--font-family-title);
}

.details-card__title_style_shelter-pets {
font-weight: 400;
}
18 changes: 9 additions & 9 deletions src/components/DetailsCard/svg/Arrow.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
.arrow {
width: 37px;
height: 22px;
transition: transform .7s;
.caret {
width: 24px;
height: 24px;
transition: transform 0.7s;
}

.arrow path {
transition-duration: .3s;
.caret path {
transition-duration: 0.3s;
fill: var(--color-text-base);
}

.details-card:hover .arrow path {
.details-card:hover .caret path {
fill: var(--color-accent-hover);
}

.details-card__summary:focus .arrow path {
.details-card__summary:focus .caret path {
fill: var(--color-accent-pressed);
}

.details-card[open] .arrow {
.details-card[open] .caret {
transform: rotate(180deg);
}
2 changes: 1 addition & 1 deletion src/components/DetailsCard/svg/Arrow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './Arrow.css';

const Arrow = () => {
return (
<svg className='arrow' width='36' height='21' viewBox='0 0 36 21' fill='none' xmlns='http://www.w3.org/2000/svg'>
<svg className='caret' width='36' height='21' viewBox='0 0 36 21' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d={`M34.9204 1.25245C35.7015 2.0335 35.7015 3.29983 34.9204 4.08088L19.4155 19.5858C18.6345 20.3668 17.3681 20.3668 16.5871
19.5858L1.08218 4.08088C0.301133 3.29983 0.301134 2.0335 1.08218 1.25245L1.50792 0.826714C2.28897 0.0456657 3.5553 0.0456657 4.33635
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfoTooltip/InfoTooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const InfoTooltip = ({ isOpen, image, message, onClose }) => {
src={image}
/>

<p className='popup__text'>{message}</p>
<h3 className='popup__text standard-font standard-font_type_h3'>{message}</h3>

<button
type='button'
Expand Down
24 changes: 10 additions & 14 deletions src/components/InfoTooltip/InfoTooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $images-path: '../../images';
visibility: hidden;
opacity: 0;
transition: visibility 0.5s, opacity 0.5s ease-in-out;
z-index: 1;

&_opened {
display: flex;
Expand All @@ -24,45 +25,40 @@ $images-path: '../../images';

.popup__container {
width: 100%;
max-width: 636px;
max-width: 576px;
height: fit-content;
background-color: var(--color-background-additional);
border-radius: 30px;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
padding: 77px 82px 88px;
padding: 75px 100px 60px;
}

.popup__image {
width: 248px;
height: 248px;
width: 90px;
height: 90px;
margin-bottom: 35px;
}

.popup__text {
font-family: var(--font-family-title);
font-style: normal;
font-weight: 600;
font-size: 40px;
line-height: 49px;
text-align: center;
color: var(--color-text-base);
}

.popup__button-close {
background-image: url('#{$images-path}/icons/ic_button_close.svg');
background-size: contain;
border: none;
width: 36px;
height: 36px;
width: 28px;
height: 28px;
background-color: rgba(0, 0, 0, 0);
padding: 0;
margin: 0;
transition: opacity 0.2s;
position: absolute;
top: 36px;
right: 36px;
top: 28px;
right: 28px;

&:hover {
opacity: 0.6;
Expand Down
43 changes: 30 additions & 13 deletions src/components/ProfilePopup/ProfilePopup.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
import React, { useContext } from 'react';
import './ProfilePopup.css';
import React, { useContext, useEffect, useRef } from 'react';
import './ProfilePopup.scss';
import { Link } from 'react-router-dom';
import CurrentUserContext from '../../contexts/CurrentUserContext';

function ProfilePopup({ isOpen, closeProfilePopup }) {
const currentUser = useContext(CurrentUserContext);
const { username, email } = currentUser;
const ref = useRef(null);

const handleOverlayClose = (e) => {
const popup = e.target.classList;
if ((ref.current && !ref.current.contains(e.target) || popup.contains('profile-popup_opened') || popup.contains('profile-popup__button-close'))) {
closeProfilePopup();
}
};

useEffect(() => {
document.addEventListener('click', handleOverlayClose, true);
return () => {
document.removeEventListener('click', handleOverlayClose, true);
};
}, [closeProfilePopup]);

return (
<div className={`profile-popup ${isOpen && 'profile-popup_opened'}`}>
<Link className='profile-popup__name' to='/profile' onClick={closeProfilePopup}>{username}</Link>
<p className='profile-popup__email'>{email}</p>
<Link className='profile-popup__link' to='/profile/edit' onClick={closeProfilePopup}>Редактировать профиль</Link>
<Link className='profile-popup__link' to='/profile/edit/password' onClick={closeProfilePopup}>Изменить пароль</Link>
<Link className='profile-popup__button' to='/profile/sign-out' onClick={closeProfilePopup}>Выйти</Link>
<button
type='button'
className='profile-popup__button-close'
onClick={closeProfilePopup}
/>
<div className={`profile-popup ${isOpen && 'profile-popup_opened'}`} ref={ref}>
<div className='profile-popup__container'>
<Link className='profile-popup__name' to='/profile' onClick={closeProfilePopup}>{username}</Link>
<p className='profile-popup__email'>{email}</p>
<Link className='profile-popup__link' to='/profile/edit' onClick={closeProfilePopup}>Редактировать профиль</Link>
<Link className='profile-popup__link' to='/profile/edit/password' onClick={closeProfilePopup}>Изменить пароль</Link>
<Link className='profile-popup__button' to='/profile/sign-out' onClick={closeProfilePopup}>Выйти</Link>
<button
type='button'
className='profile-popup__button-close'
onClick={closeProfilePopup}
/>
</div>
</div>
);
}
Expand Down
Loading
Loading