You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OfferCard.styled.js 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. import { Box, Container, Typography } from "@mui/material";
  2. import styled from "styled-components";
  3. import selectedTheme from "../../../themes";
  4. import { IconButton } from "../../Buttons/IconButton/IconButton";
  5. import { PrimaryButton } from "../../Buttons/PrimaryButton/PrimaryButton";
  6. import { Icon } from "../../Icon/Icon";
  7. import { ReactComponent as Eye } from "../../../assets/images/svg/eye-striked.svg";
  8. import { ReactComponent as Remove } from "../../../assets/images/svg/trash.svg";
  9. import { ReactComponent as Edit } from "../../../assets/images/svg/edit.svg";
  10. import { ReactComponent as Like } from "../../../assets/images/svg/like.svg";
  11. import { ReactComponent as Pin } from "../../../assets/images/svg/pin.svg";
  12. export const OfferCardContainer = styled(Container)`
  13. display: ${(props) => (props.skeleton ? "none" : "flex")};
  14. flex-direction: column;
  15. width: ${(props) => (!props.halfwidth ? "100%" : "49%")};
  16. box-sizing: border-box;
  17. margin: 10px 0;
  18. background-color: ${(props) =>
  19. props.sponsored === "true"
  20. ? selectedTheme.backgroundSponsoredColor
  21. : "white"};
  22. border-radius: 4px;
  23. ${(props) =>
  24. props.sponsored === "true" &&
  25. `border: 1px solid ${selectedTheme.borderSponsoredColor};`}
  26. padding: 16px;
  27. max-width: 2000px;
  28. height: 180px;
  29. position: relative;
  30. @media (max-width: 550px) {
  31. height: 194px;
  32. padding: 18px;
  33. padding-top: 12px;
  34. ${(props) =>
  35. props.vertical &&
  36. `
  37. height: 330px;
  38. width: 180px;
  39. margin: 0 18px;
  40. `}
  41. }
  42. `;
  43. export const OfferFlexContainer = styled(Container)`
  44. display: flex;
  45. flex-direction: row;
  46. margin: 0;
  47. padding: 0;
  48. max-height: 184px;
  49. @media (max-width: 600px) {
  50. ${(props) =>
  51. props.vertical &&
  52. `
  53. flex-direction: column;
  54. `}
  55. }
  56. `;
  57. export const OfferImage = styled.img`
  58. max-width: 144px;
  59. max-height: 144px;
  60. width: 144px;
  61. height: 144px;
  62. @media (max-width: 600px) {
  63. ${(props) =>
  64. !props.vertical &&
  65. `
  66. max-width: 108px;
  67. max-height: 108px;
  68. width: 108px;
  69. height: 108px;
  70. `}
  71. }
  72. `;
  73. export const OfferInfo = styled(Box)`
  74. display: flex;
  75. flex: 2;
  76. flex-direction: column;
  77. justify-content: space-between;
  78. margin-left: 18px;
  79. ${(props) =>
  80. props.vertical &&
  81. `
  82. margin-left: 0;
  83. margin-top: 5px;
  84. `}
  85. `;
  86. export const OfferTitle = styled(Typography)`
  87. font-family: "Open Sans";
  88. flex: 1;
  89. color: ${selectedTheme.primaryPurple};
  90. font-weight: 700;
  91. font-size: 24px;
  92. width: calc(100% - 120px);
  93. cursor: pointer;
  94. overflow: hidden;
  95. line-height: 33px;
  96. display: -webkit-box;
  97. -webkit-line-clamp: 1;
  98. -webkit-box-orient: vertical;
  99. max-height: 33px;
  100. margin-bottom: 28px;
  101. @media (max-width: 550px) {
  102. width: 100%;
  103. font-size: 18px;
  104. display: none;
  105. ${(props) =>
  106. props.vertical &&
  107. `
  108. display: flex;
  109. flex: none;
  110. position: relative;
  111. line-height: 22px;
  112. margin-top: 5px;
  113. font-size: 18px;
  114. `}
  115. }
  116. `;
  117. export const OfferAuthor = styled(Box)`
  118. display: flex;
  119. flex: 1;
  120. flex-direction: column;
  121. `;
  122. export const OfferAuthorName = styled(Typography)`
  123. font-family: "Open Sans";
  124. line-height: 22px;
  125. font-size: 16px;
  126. color: ${selectedTheme.primaryText};
  127. @media (max-width: 600px) {
  128. font-size: 14px;
  129. ${(props) =>
  130. props.vertical &&
  131. `
  132. line-height: 19px;
  133. font-size: 14px;
  134. position: absolute;
  135. bottom: 80px;
  136. `}
  137. }
  138. `;
  139. export const OfferLocation = styled(Typography)`
  140. font-family: "Open Sans";
  141. color: ${selectedTheme.primaryDarkText};
  142. line-height: 16px;
  143. font-size: 12px;
  144. ${(props) =>
  145. props.vertical &&
  146. `
  147. font-size: 12px;
  148. margin-top: 5px;
  149. position: absolute;
  150. bottom: 61px;
  151. `}
  152. `;
  153. export const OfferDetails = styled(Box)`
  154. display: flex;
  155. flex-direction: row;
  156. flex-wrap: ${(props) => (!props.halfwidth ? "no-wrap" : "wrap")};
  157. justify-content: start;
  158. gap: 1rem;
  159. @media (max-width: 650px) {
  160. flex-direction: column;
  161. justify-content: center;
  162. gap: 0;
  163. }
  164. `;
  165. export const OfferCategory = styled(Box)`
  166. font-family: "Open Sans";
  167. color: ${selectedTheme.primaryText};
  168. line-height: 16px;
  169. font-size: 12px;
  170. ${(props) =>
  171. props.vertical &&
  172. `
  173. position: absolute;
  174. bottom: 15px;
  175. `}
  176. `;
  177. export const OfferPackage = styled(Box)`
  178. font-family: "Open Sans";
  179. color: ${selectedTheme.primaryText};
  180. line-height: 16px;
  181. font-size: 12px;
  182. `;
  183. export const OfferViews = styled(Box)`
  184. font-family: "Open Sans";
  185. color: ${selectedTheme.primaryText};
  186. line-height: 16px;
  187. font-size: 12px;
  188. ${(props) =>
  189. props.vertical &&
  190. `
  191. display: none;
  192. `}
  193. `;
  194. export const OfferDescriptionTitle = styled(Box)`
  195. font-family: "Open Sans";
  196. font-size: 12px;
  197. color: ${selectedTheme.primaryDarkText};
  198. line-height: 16px;
  199. `;
  200. export const OfferDescriptionText = styled(Box)`
  201. font-family: "Open Sans";
  202. font-size: 16px;
  203. color: ${selectedTheme.primaryDarkText};
  204. line-height: 22px;
  205. max-width: calc(100% - 230px);
  206. max-height: 120px;
  207. overflow: hidden;
  208. display: -webkit-box;
  209. -webkit-line-clamp: 5;
  210. -webkit-box-orient: vertical;
  211. @media (max-width: 1500px) {
  212. display: none;
  213. }
  214. `;
  215. export const OfferDescription = styled(Box)`
  216. flex: 3;
  217. margin: auto 0;
  218. padding-left: 35px;
  219. @media (max-width: 1500px) {
  220. display: none;
  221. }
  222. `;
  223. export const Line = styled(Box)`
  224. border-left: 1px solid rgba(0, 0, 0, 0.15);
  225. height: 100px;
  226. width: 0;
  227. margin: auto 0;
  228. @media (max-width: 1500px) {
  229. display: none;
  230. }
  231. `;
  232. export const DetailIcon = styled(Icon)`
  233. & svg {
  234. width: 14px;
  235. position: relative;
  236. top: -1px;
  237. }
  238. `;
  239. export const DetailText = styled(Typography)`
  240. font-family: "Open Sans";
  241. color: ${selectedTheme.primaryText};
  242. line-height: 16px;
  243. font-size: 12px;
  244. position: relative;
  245. top: -2px;
  246. left: 3px;
  247. `;
  248. export const CheckButton = styled(PrimaryButton)`
  249. width: 180px;
  250. height: 48px;
  251. position: absolute;
  252. bottom: 9px;
  253. right: 9px;
  254. &:hover button {
  255. background-color: ${selectedTheme.primaryPurple} !important;
  256. color: white !important;
  257. }
  258. @media (max-width: 650px) {
  259. display: none;
  260. }
  261. `;
  262. export const MessageIcon = styled(IconButton)`
  263. ${(props) => !props.showMessageIcon && "display: none;"}
  264. width: 40px;
  265. height: 40px;
  266. position: absolute;
  267. top: 10px;
  268. right: 10px;
  269. background-color: ${selectedTheme.primaryIconBackgroundColor};
  270. border-radius: 100%;
  271. padding-top: 2px;
  272. text-align: center;
  273. @media (max-width: 600px) {
  274. width: 30px;
  275. height: 30px;
  276. top: 16px;
  277. right: 16px;
  278. padding: 0;
  279. ${(props) =>
  280. props.vertical &&
  281. `
  282. display: none;
  283. `}
  284. & button svg {
  285. width: 16px;
  286. height: 16px;
  287. position: relative;
  288. top: -3px;
  289. left: -2.4px;
  290. }
  291. }
  292. `;
  293. export const OfferImageContainer = styled(Box)`
  294. min-width: 144px;
  295. min-height: 144px;
  296. width: 144px;
  297. height: 144px;
  298. @media (max-width: 600px) {
  299. ${(props) =>
  300. !props.vertical
  301. ? `
  302. min-width: 108px;
  303. min-height: 108px;
  304. width: 108px;
  305. height: 108px;
  306. `
  307. : `margin-top: 4px;`}
  308. border-radius: 4px;
  309. overflow: hidden;
  310. box-shadow: 4px 4px 9px rgba(0, 0, 0, 0.12);
  311. }
  312. `;
  313. export const OfferTitleAboveImage = styled(OfferTitle)`
  314. padding-bottom: 18px;
  315. padding-top: 5px;
  316. padding-left: 1px;
  317. display: block;
  318. width: 60%;
  319. max-width: 60%;
  320. height: 40px;
  321. line-height: 20px;
  322. text-overflow: ellipsis;
  323. overflow: hidden;
  324. white-space: nowrap;
  325. ${(props) => props.vertical && `display: none;`}
  326. @media (min-width: 551px) {
  327. display: none;
  328. }
  329. `;
  330. export const EyeIcon = styled(Eye)`
  331. width: 12px;
  332. height: 11px;
  333. @media (max-width: 600px) {
  334. position: relative;
  335. top: 1px !important;
  336. }
  337. `;
  338. export const RemoveIconContainer = styled(MessageIcon)`
  339. display: block;
  340. top: 18px;
  341. right: 18px;
  342. @media screen and (max-width: 600px) {
  343. position: absolute;
  344. display: block;
  345. right: 16px;
  346. top: 16px;
  347. }
  348. `;
  349. export const RemoveIcon = styled(Remove)``;
  350. export const EditIconContainer = styled(MessageIcon)`
  351. display: block;
  352. top: 18px;
  353. right: 76px;
  354. @media screen and (max-width: 600px) {
  355. position: absolute;
  356. display: block;
  357. right: 55px;
  358. top: 16px;
  359. }
  360. `;
  361. export const EditIcon = styled(Edit)``;
  362. export const LikeIconContainer = styled(MessageIcon)`
  363. display: block;
  364. opacity: ${(props) => (props.disabled ? "0.4" : "1")};
  365. ${(props) =>
  366. props.disabled &&
  367. `
  368. cursor: initial;
  369. & button {
  370. cursor: initial;
  371. }
  372. `}
  373. `;
  374. export const LikeIcon = styled(Like)`
  375. & path {
  376. stroke: ${(props) =>
  377. props.disabled
  378. ? selectedTheme.primaryPurpleDisabled
  379. : selectedTheme.primaryPurple};
  380. }
  381. `;
  382. export const PinIcon = styled(Pin)`
  383. position: absolute;
  384. top: 20px;
  385. right: 68px;
  386. @media (max-width: 600px) {
  387. top: 20px;
  388. right: 55px;
  389. }
  390. ${(props) =>
  391. props.isMyOffer &&
  392. `
  393. right: 134px;
  394. top: 26px;
  395. @media (max-width: 600px) {
  396. top: 20px;
  397. right: 94px;
  398. }
  399. `}
  400. `;