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 9.9KB

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