|
|
|
|
|
|
|
|
import { archiveActiveAdReq } from "../../store/actions/archiveActiveAd/archiveActiveAdActions"; |
|
|
import { archiveActiveAdReq } from "../../store/actions/archiveActiveAd/archiveActiveAdActions"; |
|
|
import { ADS_PAGE } from "../../constants/pages"; |
|
|
import { ADS_PAGE } from "../../constants/pages"; |
|
|
import { useHistory } from "react-router-dom"; |
|
|
import { useHistory } from "react-router-dom"; |
|
|
|
|
|
import archiveIcon from "../../assets/images/archive.png"; |
|
|
|
|
|
|
|
|
const AdDetailsPage = () => { |
|
|
const AdDetailsPage = () => { |
|
|
const theme = useTheme(); |
|
|
const theme = useTheme(); |
|
|
|
|
|
|
|
|
<sub>| {ad.totalApplicants} prijavljenih</sub> |
|
|
<sub>| {ad.totalApplicants} prijavljenih</sub> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
{!matches && ( |
|
|
|
|
|
<div className="ad-details-tech-logo-date"> |
|
|
|
|
|
<p> |
|
|
|
|
|
<span>{t("ads.adDetailsExpiredAt")}: </span> |
|
|
|
|
|
{new Date(ad.expiredAt).toLocaleDateString()} |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
{!(new Date(ad.expiredAt) < new Date()) && ( |
|
|
|
|
|
<IconButton |
|
|
|
|
|
onClick={archiveAdHandler} |
|
|
|
|
|
className={`c-btn--primary-outlined editEnableBtn c-btn userPageBtn |
|
|
|
|
|
}`} |
|
|
|
|
|
> |
|
|
|
|
|
{!matches && "Arhiviraj"} |
|
|
|
|
|
<img |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "relative", |
|
|
|
|
|
top: -0.25, |
|
|
|
|
|
paddingLeft: matches ? "0px" : "10px", |
|
|
|
|
|
}} |
|
|
|
|
|
src={archiveIcon} |
|
|
|
|
|
/> |
|
|
|
|
|
</IconButton> |
|
|
)} |
|
|
)} |
|
|
</div> |
|
|
</div> |
|
|
<div className="ad-details-content"> |
|
|
<div className="ad-details-content"> |
|
|
|
|
|
|
|
|
)} |
|
|
)} |
|
|
</div> |
|
|
</div> |
|
|
)} |
|
|
)} |
|
|
<div className="ad-details-buttons"> |
|
|
|
|
|
<Link className="ad-details-buttons-link" to="/ads"> |
|
|
|
|
|
Nazad na sve oglase |
|
|
|
|
|
</Link> |
|
|
|
|
|
{!(new Date(ad.expiredAt) < new Date()) && ( |
|
|
|
|
|
<IconButton |
|
|
|
|
|
className="c-btn c-btn--primary add-ad-btn" |
|
|
|
|
|
onClick={archiveAdHandler} |
|
|
|
|
|
> |
|
|
|
|
|
ARCHIVE AD |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
)} |
|
|
|
|
|
{!(new Date(ad.expiredAt) < new Date()) && ( |
|
|
|
|
|
<IconButton className="c-btn c-btn--primary add-ad-btn"> |
|
|
|
|
|
PRIJAVI SE |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
|
|
|
<div className="ad-details-actions"> |
|
|
|
|
|
{!matches && ( |
|
|
|
|
|
<div className="ad-details-expired-at"> |
|
|
|
|
|
<div className="ad-details-tech-logo-date"> |
|
|
|
|
|
<p> |
|
|
|
|
|
<span>{t("ads.adDetailsExpiredAt")}: </span> |
|
|
|
|
|
{new Date(ad.expiredAt).toLocaleDateString()} |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
)} |
|
|
)} |
|
|
|
|
|
<div className="ad-details-buttons"> |
|
|
|
|
|
<Link className="ad-details-buttons-link" to="/ads"> |
|
|
|
|
|
Nazad na sve oglase |
|
|
|
|
|
</Link> |
|
|
|
|
|
|
|
|
|
|
|
{!(new Date(ad.expiredAt) < new Date()) && ( |
|
|
|
|
|
<IconButton className="c-btn c-btn--primary add-ad-btn"> |
|
|
|
|
|
PRIJAVI SE |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
)} |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
)} |
|
|
)} |