Skip to content

Commit

Permalink
Merge pull request #69 from Yura-Platonov/createAdv
Browse files Browse the repository at this point in the history
Create adv
  • Loading branch information
Yura-Platonov authored Jan 4, 2024
2 parents c8214f1 + ca6a25c commit ce064ca
Show file tree
Hide file tree
Showing 10 changed files with 502 additions and 170 deletions.
59 changes: 59 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"query-string": "^8.1.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-dropzone": "^14.2.3",
"react-loader-spinner": "^5.4.5",
"react-redux": "^8.1.3",
"react-router-dom": "^6.17.0",
Expand Down
6 changes: 5 additions & 1 deletion src/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React from 'react';
import {Container, FooterWrapper, FooterContainer,ListContainer, StyledYoutubeSVG, StyledInstagramSVG, StyledFacebookSVG } from './Footer.styled';
import Logo from '../../images/Footer/Group 99footer.png';
import { NavLink } from 'react-router-dom';


const Footer = () => {
return (
<Container>
<FooterWrapper>
<img src={Logo} alt="Logo" />
<NavLink to={'/'}>
<img src={Logo} alt="Logo" />
</NavLink>
<FooterContainer>
<ListContainer>
<ul className="footer_list">
Expand Down
3 changes: 3 additions & 0 deletions src/images/AccountPage/Arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/images/AccountPage/create.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/images/AccountPage/post.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions src/modal/confirmModal/confirmModalAdvertisement.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { useDispatch } from 'react-redux';
import { ConfDiv } from './confirmModal.styled';
import { setIsOpen } from 'redux/modal/modalSlice';
import { XBTN } from './confirmModalSVG';

const СonfirmModalAdvertisement = ({ handleSearch1 }) => {
const dispatch = useDispatch();

const closeModal = () => {
dispatch(setIsOpen(false));
};

const confirmModalAdvertisement = () => {
handleSearch1({
'advertisementDTO.carDTO.carMark.name': '',
'advertisementDTO.carDTO.carMark.carModel.name': '',
'advertisementDTO.carDTO.carNumber': '',
'advertisementDTO.region.name': '',
'advertisementDTO.region.city.name': '',
'advertisementDTO.carDTO.mileage': '',
'advertisementDTO.carDTO.yearToCreate': '',
'advertisementDTO.price': '',
'advertisementDTO.carDTO.bodyType.name': '',
'advertisementDTO.carDTO.engine.name': '',
'advertisementDTO.carDTO.engine.volume': '',
'advertisementDTO.carDTO.driveType.name': '',
'advertisementDTO.carDTO.transmission.name': '',
'advertisementDTO.carDTO.technicalState.name': '',
'advertisementDTO.carDTO.color.name': '',
'advertisementDTO.carDTO.vinNumber': '',
'advertisementDTO.description': '',
'advertisementDTO.ownerName': '',
'advertisementDTO.ownerPhone': '',
});
dispatch(setIsOpen(false));
};

return (
<ConfDiv>
<button type="button" onClick={closeModal} className="xBtn">
<XBTN />
</button>
<h4 className="title">
Ви впевнені що хочете <span className="cringe">очистити</span> фільтри?
</h4>
<p className="content">
Натискаючи на кнопку “підтвердити” форма заповнення <br/>оголошення повністю очиститься
</p>
<div className="buttonBox">
<button type="button" onClick={closeModal} className="cansel">
Відмінити
</button>
<button type="button" onClick={confirmModalAdvertisement} className="confirm">
Підтвердити
</button>
</div>
</ConfDiv>
);
};

export default СonfirmModalAdvertisement;
25 changes: 25 additions & 0 deletions src/modal/modal2.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import ReactDOM from 'react-dom';

import { useSelector } from 'react-redux';
import { selectIsOpen } from 'redux/modal/modalSlice';
import ModalWraper from './modalWraper/modalWraper';
import ConfirmModalAdvertisement from './confirmModal/confirmModalAdvertisement';


const Modal = ({ handleSearch1 }) => {
const isOpen = useSelector(selectIsOpen);

return ReactDOM.createPortal(
<>
{isOpen && (
<ModalWraper>
<ConfirmModalAdvertisement handleSearch1={handleSearch1} />
</ModalWraper>
)}
</>,
document.getElementById('portal')
);
};

export default Modal;
Loading

0 comments on commit ce064ca

Please sign in to comment.