Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

OfferCard.styled.js 10KB

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