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

Develop #841

Merged
merged 27 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
31a1f6a
made animation field non-required and fixed associated code
mykola-krai Sep 21, 2023
7df29a9
Add some methods
ValDekh Sep 22, 2023
d321233
To revert
ValDekh Sep 23, 2023
aed72d8
Add some changes
ValDekh Sep 24, 2023
6132b77
Button's logic work
ValDekh Sep 25, 2023
19173b2
Do something
ValDekh Sep 25, 2023
ee7941f
add anchor to vacancies when open from modal
Oleh-Kril Sep 26, 2023
40ddfe5
Add footer Vacancies
ValDekh Sep 26, 2023
5b7fa43
remove dots from teaser
Oleh-Kril Sep 26, 2023
648407a
delete unneeded moveble line
Adeodonne Sep 26, 2023
176bffd
Revert "add anchor to vacancies when open from modal"
ValDekh Sep 26, 2023
95a2460
Revert "To revert"
ValDekh Sep 26, 2023
558110d
yarn_lock and package-lock delete
ValDekh Sep 26, 2023
f4adb27
Merge branch 'Change_join_the_team_button_valerii' of https://github.…
ValDekh Sep 26, 2023
a5401aa
Revert "To revert"
ValDekh Sep 26, 2023
7477967
fix loader and remove scrollbar when loading
Oleh-Kril Sep 26, 2023
122f3f1
Merge pull request #800 from ita-social-projects/make-animation-field…
MementoMorj Sep 26, 2023
b96c7e8
Correction for review
ValDekh Sep 26, 2023
df8cde8
Merge pull request #834 from ita-social-projects/remove_dots_from_teaser
MementoMorj Sep 26, 2023
9e3d547
Merge pull request #833 from ita-social-projects/Change_join_the_team…
MementoMorj Sep 26, 2023
4c2150e
Merge branch 'develop' into fix-not-needed-moveble-line
MementoMorj Sep 26, 2023
b72b81d
Merge pull request #836 from ita-social-projects/fix-not-needed-moveb…
MementoMorj Sep 26, 2023
75a0029
Merge pull request #838 from ita-social-projects/fix-streetcode-loader
MementoMorj Sep 26, 2023
1dba05c
add link to google drive
MementoMorj Sep 26, 2023
7b587e5
Merge pull request #839 from ita-social-projects/feature-reporting-link
MementoMorj Sep 26, 2023
3a28cc2
streetcode-partners-fix
MementoMorj Sep 26, 2023
7f53159
Merge pull request #840 from ita-social-projects/feature-reporting-link
MementoMorj Sep 26, 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"react-resize-detector": "^7.1.2",
"react-responsive": "^9.0.2",
"react-router-dom": "^6.8.1",
"react-router-hash-link": "^2.4.3",
"react-scripts": "5.0.1",
"react-slick": "^0.29.0",
"react-slider": "^2.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,50 @@ import './HeaderLoginModal.styles.scss';
import CancelBtn from '@images/utils/Cancel_btn.svg';

import { observer } from 'mobx-react-lite';
import { useNavigate } from 'react-router-dom';
import React, { useEffect, useState } from 'react';
import { HashLink as Link } from 'react-router-hash-link';
import FRONTEND_ROUTES from '@constants/frontend-routes.constants';
import { useModalContext } from '@stores/root-store';
import scrollWithOffset from '@utils/window.utility';

import { Button, Modal } from 'antd';

import JobApi from '@/app/api/job/Job.api';
import {
becomePartnerEvent,
donateEvent,
joinToStreetcodeClickEvent,
} from '@/app/common/utils/googleAnalytics.unility';

const HeaderLoginModal = () => {
const SURVEY_LINK = "https://forms.gle/eWwX5RP84X7dymLR6";
const [hasVacancies, setHasVacancies] = useState(false);
const SURVEY_LINK = 'https://forms.gle/eWwX5RP84X7dymLR6';
const { modalStore: { setModal, modalsState: { login } } } = useModalContext();
const navigate = useNavigate();

useEffect(() => {
JobApi.getActive()
.then(
(result) => {
setHasVacancies(result.length > 0);
},
)
.catch(
(e) => {
console.log(e);
},
);
}, [login.isOpen]);

const becomePartnerHandler = () => {
login.isOpen = false;
setModal('partners');
becomePartnerEvent('modal');
};

const joinToTeamHandler = () => {
login.isOpen = false;
};

return (
<Modal
className="loginModal"
Expand All @@ -43,14 +64,20 @@ const HeaderLoginModal = () => {
<Button onClick={becomePartnerHandler}>
Стати партнером
</Button>
<Button onClick={() => {
joinToStreetcodeClickEvent();
navigate(`${FRONTEND_ROUTES.OTHER_PAGES.ERROR404}`);
login.isOpen = false;
}}
>
Долучитися до команди
</Button>
{hasVacancies && (
<Button onClick={() => {
joinToStreetcodeClickEvent();
joinToTeamHandler();
}}
>
<Link
to={`${FRONTEND_ROUTES.OTHER_PAGES.ABOUT_US}#vacancies`}
scroll={(el:any) => scrollWithOffset(el, 100)}
>
Долучитися до команди
</Link>
</Button>
)}
<Button onClick={() => {
setModal('donates');
setModal('login');
Expand Down
10 changes: 10 additions & 0 deletions src/app/common/utils/window.utility.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const scrollWithOffset = (el: any, offset: number) => {
const elementPosition = el.offsetTop - offset;
window.scroll({
top: elementPosition,
left: 0,
behavior: 'smooth',
});
};

export default scrollWithOffset;
32 changes: 30 additions & 2 deletions src/app/layout/footer/Footer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ import TikTok from '@images/footer/TikTok.webp';
import Twitter from '@images/footer/Twitter.webp';
import Youtube from '@images/footer/Youtube.webp';

import { useEffect, useState } from 'react';
import { HashLink as Link } from 'react-router-hash-link';
import useWindowSize from '@hooks/stateful/useWindowSize.hook';

import JobApi from '@/app/api/job/Job.api';
import FRONTEND_ROUTES from '@/app/common/constants/frontend-routes.constants';
import scrollWithOffset from '@/app/common/utils/window.utility';

const Footer = () => {
const windowSize = useWindowSize();
const [hasVacancies, setHasVacancies] = useState(false);
useEffect(() => {
JobApi.getActive()
.then(
(result) => {
setHasVacancies(result.length > 0);
},
)
.catch();
}, []);
return (
<>
{windowSize.width > 1024 && (
Expand All @@ -29,12 +43,22 @@ const Footer = () => {
</ul>
<ul className="usefulLinksColumn">
<li><a href={FRONTEND_ROUTES.OTHER_PAGES.PARTNERS}>Партнери</a></li>
<li><a href={FRONTEND_ROUTES.OTHER_PAGES.ERROR404}>Вакансії</a></li>
{hasVacancies ? (
<li>
<Link
to={`${FRONTEND_ROUTES.OTHER_PAGES.ABOUT_US}#vacancies`}
scroll={(el:any) => scrollWithOffset(el, 100)}
>
Вакансії
</Link>
</li>
) : null}
<li><a href={FRONTEND_ROUTES.OTHER_PAGES.SUPPORT_US}>Донати</a></li>
</ul>
<ul className="usefulLinksColumn supportLinks">
<li><a href={FRONTEND_ROUTES.OTHER_PAGES.PRIVACY_POLICY}>Політика конфіденційності</a></li>
<li><a href={FRONTEND_ROUTES.OTHER_PAGES.CONTACT_US}>Зворотний зв&apos;язок</a></li>
<li><a href="https://drive.google.com/drive/folders/11Ef4y_6ZHyqT5eDxD5Cn-aWhr-kThh3A?usp=drive_link" target="_blank" rel="noreferrer">Звітність ГО «Історична Платформа»</a></li>
</ul>
<ul className="socialIconContainer">
<li>
Expand Down Expand Up @@ -69,7 +93,11 @@ const Footer = () => {
<section>
<div className="footerCopyright">
<p>
© {new Date().getFullYear()} ГО «Історична Платформа». При використанні матеріалів сайту посилання на джерело
©
{' '}
{new Date().getFullYear()}
{' '}
ГО «Історична Платформа». При використанні матеріалів сайту посилання на джерело
обов’язкове.
</p>
</div>
Expand Down
12 changes: 11 additions & 1 deletion src/app/router/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { createBrowserRouter, createHashRouter, createRoutesFromElements, Route } from 'react-router-dom';
import {
createBrowserRouter, createHashRouter, createRoutesFromElements, Route, Routes, useParams,
} from 'react-router-dom';
import FRONTEND_ROUTES from '@constants/frontend-routes.constants';
import ForFansMainPage from '@features/AdminPage/ForFansPage/ForFansMainPage.component';
import App from '@layout/app/App.component';
import StreetcodeContent from '@streetcode/Streetcode.component';

import ProtectedComponent from '@/app/common/components/ProtectedComponent.component';

import AboutUsPage from '@/features/AboutUsPage/AboutUsPage.component';
import Vacancies from '@/features/AboutUsPage/Vacancies/Vacancies.component';

import ContactUs from '@/features/AdditionalPages/ContactUsPage/ContanctUs.component';
import NewsPage from '@/features/AdditionalPages/NewsPage/News.component';
import NotFound from '@/features/AdditionalPages/NotFoundPage/NotFound.component';
Expand Down Expand Up @@ -86,6 +92,10 @@ const router = createBrowserRouter(createRoutesFromElements(
<Route index path="/:id" element={<StreetcodeContent />} />
<Route index path={`${FRONTEND_ROUTES.OTHER_PAGES.NEWS}/:id`} element={<NewsPage />} />
<Route path={FRONTEND_ROUTES.OTHER_PAGES.ABOUT_US} element={<AboutUsPage />} />
<Route
path={`${FRONTEND_ROUTES.OTHER_PAGES.ABOUT_US}/:section`}
element={<AboutUsPage />}
/>
</Route>,
));

Expand Down
47 changes: 35 additions & 12 deletions src/features/AboutUsPage/AboutUsPage.component.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
import './AboutUsPage.styles.scss';

import TickerComponent from '../StreetcodePage/TickerBlock/Ticker.component';
import React, { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';

import AboutUsHeaderText from './AboutUsHeaderText/AboutUsHeaderText.component';
import Founders from './Founders/Founders.component';
import TeamMembers from './TeamMembers/TeamMembers.component';
import Vacancies from './Vacancies/Vacancies.component';

const AboutUsPage = () => (
<div className="aboutUsPageContainer">
<div className="contentContainer">
{<AboutUsHeaderText />}
{<Founders />}
{<TeamMembers />}
{<Vacancies />}
</div>
<TickerComponent type="teamMembers" />
</div>
);
const AboutUsPage = () => {
const [hasVacancies, setHasVacancies] = useState(false);
const location = useLocation();
const section = location.hash.substring(1);
console.log('section:', section);

useEffect(() => {
const scrollToSection = (sectionName: string) => {
const sectionElement = document.getElementById(sectionName);
if (sectionElement) {
sectionElement.scrollIntoView({ behavior: 'smooth' });
}
};

if (section === 'vacancies') {
scrollToSection('vacancies-section');
} else {
window.scrollTo(0, 0);
}
}, [section]);

return (
<div className="aboutUsPageContainer">
<div className="contentContainer">
<AboutUsHeaderText />
<Founders />
<TeamMembers />
<div id="vacancies-section">
<Vacancies setHasVacancies={setHasVacancies} />
</div>
</div>
</div>
);
};
export default AboutUsPage;
27 changes: 14 additions & 13 deletions src/features/AboutUsPage/TeamMembers/TeamMembers.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ const TeamMembers = () => {

return (
positions.length
&& (
<div className="aboutUsBlockContainer">
<SliderComponents
positions={positions}
setActive={setPositionId}
/>
{window.innerWidth <= SCREEN_SIZES.tablet ? (
<TeamMemberSlider team={team} />
) : (
<TeamMemberList teamMembers={team} />
)}
</div>
)
? (
<div className="aboutUsBlockContainer">
<SliderComponents
positions={positions}
setActive={setPositionId}
/>
{window.innerWidth <= SCREEN_SIZES.tablet ? (
<TeamMemberSlider team={team} />
) : (
<TeamMemberList teamMembers={team} />
)}
</div>
)
: null
);
};
export default TeamMembers;
8 changes: 4 additions & 4 deletions src/features/AboutUsPage/Vacancies/Vacancies.component.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import './Vacancies.styles.scss';

import { useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';

import JobApi from '@/app/api/job/Job.api';

import Vacancy from './Vacancy/Vacancy.component';

const Vacancies = () => {
const Vacancies = ({ setHasVacancies } : { setHasVacancies: (hasVacancies: boolean) => void }) => {
const [jobs, setJobs] = useState<Job[]>([]);

useEffect(() => {
JobApi.getActive()
.then(
(result) => {
setJobs(result);
setHasVacancies(result.length > 0);
},
)
.catch(
Expand All @@ -22,11 +23,10 @@ const Vacancies = () => {
},
);
}, []);

return (
jobs.length
? (
<div className="aboutUsBlockContainer">
<div id="vacancies" className="aboutUsBlockContainer">
<h1>
<div />
<span>Вакансії</span>
Expand Down
51 changes: 34 additions & 17 deletions src/features/AboutUsPage/Vacancies/Vacancy/Vacancy.component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import './Vacancy.syles.scss';

import { useState } from 'react';
import './Vacancy.syles.scss'

import VacancyModal from './VacancyModal/VacancyModal.component';

const Vacancy = (job: Job) => {
Expand All @@ -8,28 +10,43 @@ const Vacancy = (job: Job) => {

const ChangeStatus = () => {
setIsModalOpen(!isModalOpen);
}
};
return (
<div className='vacancyContainer'>
<div className="vacancyContainer">
<h2>{job.title}</h2>
<h3>{job.salary}</h3>
{
job.description.length < maxLength
? <p>{job.description}
<label
onClick={ () => {setIsModalOpen(true)}}> Трохи ще
</label>
</p>
: <p>{job.description.substring(0, maxLength)}...
<label
onClick={ () => {setIsModalOpen(true)}}>
job.description.length < maxLength
? (
<p>
{job.description}
<label
onClick={() => {
setIsModalOpen(true);
}}
>
{' '}
Трохи ще
</label>
</p>
)
: (
<p>
{job.description.substring(0, maxLength)}
...
<label
onClick={() => {
setIsModalOpen(true);
}}
>
Трохи ще
</label>
</p>
</label>
</p>
)
}
<VacancyModal isOpen={isModalOpen} setOpen={ChangeStatus} job = {job}/>
<VacancyModal isOpen={isModalOpen} setOpen={ChangeStatus} job={job} />
</div>
)
);
};

export default Vacancy
export default Vacancy;
Loading
Loading