diff --git a/BackEnd/forum/pagination.py b/BackEnd/forum/pagination.py index af032e4b3..a6158a910 100644 --- a/BackEnd/forum/pagination.py +++ b/BackEnd/forum/pagination.py @@ -7,6 +7,12 @@ class ForumPagination(PageNumberPagination): page_size_query_param = "page_size" max_page_size = 64 + def get_page_number(self, request, paginator): + page_number = super().get_page_number(request, paginator) + if int(page_number) > paginator.num_pages: + page_number = paginator.num_pages or 1 + return page_number + def get_paginated_response(self, data): return Response( { diff --git a/FrontEnd/public/favicon-16x16.png b/FrontEnd/public/favicon-16x16.png index 9839240bb..14c58dcad 100644 Binary files a/FrontEnd/public/favicon-16x16.png and b/FrontEnd/public/favicon-16x16.png differ diff --git a/FrontEnd/public/favicon-32x32.png b/FrontEnd/public/favicon-32x32.png index 71ddb1293..c71d92a98 100644 Binary files a/FrontEnd/public/favicon-32x32.png and b/FrontEnd/public/favicon-32x32.png differ diff --git a/FrontEnd/public/favicon.ico b/FrontEnd/public/favicon.ico index 63eabdcfd..bd10115ab 100644 Binary files a/FrontEnd/public/favicon.ico and b/FrontEnd/public/favicon.ico differ diff --git a/FrontEnd/public/forum-logo.ico b/FrontEnd/public/forum-logo.ico deleted file mode 100644 index 62bea69b4..000000000 Binary files a/FrontEnd/public/forum-logo.ico and /dev/null differ diff --git a/FrontEnd/public/img/cookies.png b/FrontEnd/public/img/cookies.png new file mode 100644 index 000000000..530b9351b Binary files /dev/null and b/FrontEnd/public/img/cookies.png differ diff --git a/FrontEnd/public/svg/arrow-down.svg b/FrontEnd/public/svg/arrow-down.svg new file mode 100644 index 000000000..96d156440 --- /dev/null +++ b/FrontEnd/public/svg/arrow-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/arrow-up.svg b/FrontEnd/public/svg/arrow-up.svg new file mode 100644 index 000000000..224c57140 --- /dev/null +++ b/FrontEnd/public/svg/arrow-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/baget.svg b/FrontEnd/public/svg/baget.svg new file mode 100644 index 000000000..c56202f38 --- /dev/null +++ b/FrontEnd/public/svg/baget.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/car.svg b/FrontEnd/public/svg/car.svg new file mode 100644 index 000000000..23e6ebbf1 --- /dev/null +++ b/FrontEnd/public/svg/car.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/hotel.svg b/FrontEnd/public/svg/hotel.svg new file mode 100644 index 000000000..f74fcef79 --- /dev/null +++ b/FrontEnd/public/svg/hotel.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/people.svg b/FrontEnd/public/svg/people.svg new file mode 100644 index 000000000..a729ee4e5 --- /dev/null +++ b/FrontEnd/public/svg/people.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/post.svg b/FrontEnd/public/svg/post.svg new file mode 100644 index 000000000..71e6ed313 --- /dev/null +++ b/FrontEnd/public/svg/post.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/rocket.svg b/FrontEnd/public/svg/rocket.svg new file mode 100644 index 000000000..044c4b44f --- /dev/null +++ b/FrontEnd/public/svg/rocket.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/shop.svg b/FrontEnd/public/svg/shop.svg new file mode 100644 index 000000000..7b4f5365c --- /dev/null +++ b/FrontEnd/public/svg/shop.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/public/svg/wine.svg b/FrontEnd/public/svg/wine.svg new file mode 100644 index 000000000..bf9f7f6a3 --- /dev/null +++ b/FrontEnd/public/svg/wine.svg @@ -0,0 +1,3 @@ + + + diff --git a/FrontEnd/src/App.css b/FrontEnd/src/App.css index f7965b367..d90ac7999 100644 --- a/FrontEnd/src/App.css +++ b/FrontEnd/src/App.css @@ -5,4 +5,4 @@ body { width: 100vw; -} \ No newline at end of file +} diff --git a/FrontEnd/src/components/CompanyCard/CompanyCard.jsx b/FrontEnd/src/components/CompanyCard/CompanyCard.jsx index 00f1e77c7..7870c6d03 100644 --- a/FrontEnd/src/components/CompanyCard/CompanyCard.jsx +++ b/FrontEnd/src/components/CompanyCard/CompanyCard.jsx @@ -1,4 +1,5 @@ import { Link } from 'react-router-dom'; +import { mutate } from 'swr'; import styles from './CompanyCard.module.css'; import { useAuth } from '../../hooks'; import PropTypes from 'prop-types'; @@ -45,6 +46,11 @@ export default function CompanyCard({ changeCompanies(profile.id, false); try { await axios.delete(`${process.env.REACT_APP_BASE_API_URL}/api/saved-list/${profile.id}`); + await mutate( + (key) => typeof key === 'string' && key.includes('/api/profiles/?is_saved=True'), + undefined, + {revalidate: true} + ); } catch (error) { console.error(error); } diff --git a/FrontEnd/src/components/CompanyCard/CompanyCard.module.css b/FrontEnd/src/components/CompanyCard/CompanyCard.module.css index 3fcdb3bc6..0cb137dfd 100644 --- a/FrontEnd/src/components/CompanyCard/CompanyCard.module.css +++ b/FrontEnd/src/components/CompanyCard/CompanyCard.module.css @@ -2,11 +2,11 @@ width: 345px; height: 365px; display: block; - align-items: center; border-radius: 11px; position: relative; margin: auto; background: var(--company-card-color); + box-shadow: 0px 0px 2px 0px #41404533; } .company-card:hover { @@ -80,7 +80,8 @@ text-align: left; padding-left: 16px; padding-top: 6px; - max-width: 300px; + max-width: 262px; + height: 35px; } .company-card__name-text { @@ -152,7 +153,7 @@ height: 50px; background: var(--company-card-color); border-radius: 9999px; - border: 2px solid #232424; + border: 1px solid var(--grey-border-color); } .company-card__logo-image { @@ -183,6 +184,6 @@ } .company-card__category-text { - max-width: 250px; + max-width: 220px; } } diff --git a/FrontEnd/src/components/Contact/Contact.jsx b/FrontEnd/src/components/Contact/Contact.jsx deleted file mode 100644 index 626c0b888..000000000 --- a/FrontEnd/src/components/Contact/Contact.jsx +++ /dev/null @@ -1,198 +0,0 @@ -import { useState, useEffect, useRef } from 'react'; -import { useForm, Controller } from 'react-hook-form'; -import { Link } from 'react-router-dom'; -import axios from 'axios'; -import { Spin, Select, Space } from 'antd'; - -import { - EMAIL_PATTERN, - MESSAGE_PATTERN -} from '../../constants/constants'; - -import LinkContainer from '../../pages/CookiesPolicyPage/LinkContainer.jsx'; - -import styles from './Contact.module.css'; - -const CATEGORY_OPTIONS = [ - { value: 'Технічне питання', label: 'Технічне питання' }, - { value: 'Рекомендації', label: 'Рекомендації' }, - { value: 'Питання', label: 'Питання' }, - { value: 'Інше', label: 'Інше' }, -]; - -const Contact = () => { - const [loading, setLoading] = useState(false); - const [modalMessage, setModalMessage] = useState(''); - const [percent, setPercent] = useState(-50); - const timerRef = useRef(); - - useEffect(() => { - timerRef.current = setTimeout(() => { - setPercent((v) => { - const nextPercent = v + 5; - return nextPercent > 150 ? -50 : nextPercent; - }); - }, 100); - return () => clearTimeout(timerRef.current); - }, [percent]); - - const { - register, - handleSubmit, - reset, - control, - formState: { errors }, - } = useForm({ - mode: 'all', - defaultValues: { - 'message': 'Привіт, хочу повідомити...', - 'email': '', - }, - }); - - const onSubmit = async (value) => { - setLoading(true); - try { - const response = await axios.post(`${process.env.REACT_APP_BASE_API_URL}/api/admin/feedback/`, { - email: value.email, - message: value.message, - category: value.category, - }); - - if (response.status === 200 || response.status === 201) { - setModalMessage('Повідомлення успішно надіслано!'); - reset(); - } - } catch (error) { - setModalMessage('Щось пішло не так! Будь ласка, спробуйте ще раз!'); - } finally { - setLoading(false); - } - }; - - const handleCancel = () => { - reset(); - }; - - const closeModal = () => { - setModalMessage(''); - }; - - return ( -
-
- - decorative dot pattern -
-
-

Зворотній зв'язок

-
-
- - - {errors.email &&

{errors.email.message}

} -
-
- - - -