| @@ -50,6 +50,7 @@ const UserReviewsCard = (props) => { | |||
| props?.review?.userWhoGaveReview?.image, | |||
| userWhoReceived: | |||
| props?.review?.reviewAdditionalData?.userWhoReceived?.company?.name, | |||
| _deleted: props?.review?._deleted, | |||
| }; | |||
| }, [props.review]); | |||
| const handleRemove = () => { | |||
| @@ -5,10 +5,11 @@ import { RemoveButtonContainer, RemoveIcon } from "./RemoveButton.styled"; | |||
| const RemoveButton = (props) => { | |||
| return ( | |||
| <RemoveButtonContainer | |||
| isRemoved={props.isRemoved} | |||
| onClick={props.onClick} | |||
| hasGivenReview={props.hasGivenReview} | |||
| > | |||
| <RemoveIcon /> | |||
| <RemoveIcon isRemoved={props.isRemoved} /> | |||
| </RemoveButtonContainer> | |||
| ); | |||
| }; | |||
| @@ -17,6 +18,7 @@ RemoveButton.propTypes = { | |||
| children: PropTypes.node, | |||
| onClick: PropTypes.func, | |||
| hasGivenReview: PropTypes.bool, | |||
| isRemoved: PropTypes.bool, | |||
| }; | |||
| export default RemoveButton; | |||
| @@ -1,5 +1,5 @@ | |||
| // import { Box } from "@mui/material"; | |||
| import styled from "styled-components"; | |||
| import styled, { css } from "styled-components"; | |||
| import { ReactComponent as Remove } from "../../../../../assets/images/svg/trash.svg"; | |||
| import selectedTheme from "../../../../../themes"; | |||
| import { IconButton } from "../../../../Buttons/IconButton/IconButton"; | |||
| @@ -8,13 +8,23 @@ export const RemoveButtonContainer = styled(IconButton)` | |||
| position: absolute; | |||
| top: ${(props) => (props.hasGivenReview ? "79px" : "16px")}; | |||
| right: 16px; | |||
| background-color: ${selectedTheme.colors.primaryIconBackgroundColor}; | |||
| background-color: ${props => props.isRemoved ? "transparent" : selectedTheme.colors.primaryIconBackgroundColor}; | |||
| border-radius: 100%; | |||
| width: 32px; | |||
| height: 32px; | |||
| ${props => props.isRemoved && css` | |||
| & button:hover { | |||
| background-color: transparent; | |||
| cursor: auto; | |||
| } | |||
| `} | |||
| & button { | |||
| width: 32px; | |||
| height: 32px; | |||
| } | |||
| `; | |||
| export const RemoveIcon = styled(Remove)``; | |||
| export const RemoveIcon = styled(Remove)` | |||
| & path { | |||
| stroke: ${props => props.isRemoved && selectedTheme.colors.blockedColor}; | |||
| } | |||
| `; | |||
| @@ -3,7 +3,7 @@ import styled from "styled-components"; | |||
| import selectedTheme from "../../../../../themes"; | |||
| export const ReviewDetailsContainer = styled(Grid)` | |||
| padding-bottom: 1rem; | |||
| padding-bottom: 21px; | |||
| `; | |||
| export const ReviewDetailsText = styled(Typography)` | |||
| font-family: ${selectedTheme.fonts.textFont}; | |||
| @@ -14,7 +14,7 @@ export const ReviewQuoteContainer = styled(Box)` | |||
| margin-top: 18px; | |||
| align-items: center; | |||
| justify-content: start; | |||
| margin-bottom: 15px; | |||
| margin-bottom: 21px; | |||
| `; | |||
| export const ThumbContainer = styled(Grid)` | |||
| max-width: 20px; | |||
| @@ -12,8 +12,13 @@ const UserReviewsSingleCard = (props) => { | |||
| const handleRemove = () => { | |||
| props.handleRemove(); | |||
| }; | |||
| console.log(props.review); | |||
| return ( | |||
| <ReviewContainer> | |||
| <ReviewContainer | |||
| lastReview={props.lastReview} | |||
| className={props.className} | |||
| hasGivenReview={props.hasGivenReview} | |||
| > | |||
| {props.isAdmin && !props.rightReviews && props.hasGivenReview && ( | |||
| <GivenReviewsHeader | |||
| hasGivenReview={props.hasGivenReview} | |||
| @@ -38,6 +43,7 @@ const UserReviewsSingleCard = (props) => { | |||
| review={props.review} | |||
| onClick={handleRemove} | |||
| hasGivenReview={props.hasGivenReview} | |||
| isRemoved={props.review?._deleted} | |||
| /> | |||
| )} | |||
| <ReviewOffer | |||
| @@ -56,6 +62,15 @@ UserReviewsSingleCard.propTypes = { | |||
| userWhoReceived: PropTypes.any, | |||
| rightReviews: PropTypes.bool, | |||
| isAdmin: PropTypes.bool, | |||
| className: PropTypes.string, | |||
| lastReview: PropTypes.bool, | |||
| }; | |||
| UserReviewsSingleCard.defaultProps = { | |||
| lastReview: false, | |||
| isAdmin: false, | |||
| rightReviews: false, | |||
| hasGivenReview: false, | |||
| showRemoveIcon: false, | |||
| }; | |||
| export default UserReviewsSingleCard; | |||
| @@ -1,5 +1,5 @@ | |||
| import { Box } from "@mui/material"; | |||
| import styled from "styled-components"; | |||
| import styled, { css } from "styled-components"; | |||
| import selectedTheme from "../../../../themes"; | |||
| export const ReviewContainer = styled(Box)` | |||
| @@ -7,16 +7,21 @@ export const ReviewContainer = styled(Box)` | |||
| padding-right: 12px; | |||
| position: relative; | |||
| @media (max-width: 600px) { | |||
| height: 258px; | |||
| } | |||
| &::after { | |||
| content: ""; | |||
| display: block; | |||
| border-bottom: 1px solid ${selectedTheme.colors.primaryIconBackgroundColor}; | |||
| width: calc(100% + 24.4px); | |||
| height: 1px; | |||
| position: relative; | |||
| left: -18px; | |||
| margin-top: 18px; | |||
| height: ${props => props.hasGivenReview ? "323px" : "258px"}; | |||
| } | |||
| ${(props) => | |||
| !props.lastReview && | |||
| css` | |||
| &::after { | |||
| content: ""; | |||
| display: block; | |||
| border-bottom: 1px solid | |||
| ${selectedTheme.colors.primaryIconBackgroundColor}; | |||
| width: calc(100% + 24.4px); | |||
| height: 1px; | |||
| position: relative; | |||
| left: -18px; | |||
| margin-top: 18px; | |||
| } | |||
| `} | |||
| `; | |||
| @@ -3,18 +3,24 @@ import styled from "styled-components"; | |||
| import { PrimaryButton } from "../../../Buttons/PrimaryButton/PrimaryButton"; | |||
| export const DeleteButtonContainer = styled(Box)` | |||
| position: absolute; | |||
| bottom: 36px; | |||
| left: 18px; | |||
| background-color: white !important; | |||
| border: 0 !important; | |||
| padding: 0 !important; | |||
| @media (max-width: 600px) { | |||
| position: absolute; | |||
| bottom: 36px; | |||
| left: 18px; | |||
| } | |||
| `; | |||
| export const ButtonContainer = styled(PrimaryButton)` | |||
| height: 44px; | |||
| width: calc(100vw - 36px); | |||
| width: 335px; | |||
| margin: 18px auto; | |||
| background-color: white !important; | |||
| & > button { | |||
| background-color: ${(props) => props.buttoncolor} !important; | |||
| } | |||
| @media (max-width: 600px) { | |||
| width: calc(100vw - 36px); | |||
| } | |||
| `; | |||
| @@ -3,10 +3,10 @@ import PropTypes from "prop-types"; | |||
| import { | |||
| DeleteReviewContainer, | |||
| DeleteReviewTitle, | |||
| ReviewCard, | |||
| XIcon, | |||
| } from "./DeleteReview.styled"; | |||
| import BackdropComponent from "../../MUI/BackdropComponent"; | |||
| import UserReviewsSingleCard from "../../Cards/UserReviewsCard/UserReviewsSingleCard/UserReviewsSingleCard"; | |||
| import { useTranslation } from "react-i18next"; | |||
| import DeleteButton from "./DeleteButton/DeleteButton"; | |||
| import { useDispatch } from "react-redux"; | |||
| @@ -38,9 +38,9 @@ const DeleteReview = (props) => { | |||
| /> | |||
| <DeleteReviewContainer> | |||
| <DeleteReviewTitle>{t("admin.review.title")}</DeleteReviewTitle> | |||
| <UserReviewsSingleCard | |||
| showRemoveIcon | |||
| <ReviewCard | |||
| deleteModal | |||
| lastReview | |||
| review={props.review} | |||
| /> | |||
| <XIcon onClick={closeModalHandler} /> | |||
| @@ -2,16 +2,18 @@ import { Box, Typography } from "@mui/material"; | |||
| import styled from "styled-components"; | |||
| import selectedTheme from "../../../themes"; | |||
| import { ReactComponent as X } from "../../../assets/images/svg/plus.svg"; | |||
| import UserReviewsSingleCard from "../../Cards/UserReviewsCard/UserReviewsSingleCard/UserReviewsSingleCard"; | |||
| export const DeleteReviewContainer = styled(Box)` | |||
| position: fixed; | |||
| width: 100vw; | |||
| height: 100vh; | |||
| top: 0; | |||
| left: 0; | |||
| top: 50%; | |||
| left: 50%; | |||
| transform: translate(-50%, -50%); | |||
| width: 623px; | |||
| min-height: 492px; | |||
| background-color: white; | |||
| z-index: 150; | |||
| padding: 28px; | |||
| padding: 37px; | |||
| & > div { | |||
| margin: 0 auto; | |||
| background-color: ${selectedTheme.colors.skeletonItemColor}; | |||
| @@ -24,6 +26,9 @@ export const DeleteReviewContainer = styled(Box)` | |||
| } | |||
| @media (max-width: 600px) { | |||
| padding: 36px 28px; | |||
| width: 100vw; | |||
| min-height: 0; | |||
| height: 100vh; | |||
| } | |||
| `; | |||
| export const DeleteReviewTitle = styled(Typography)` | |||
| @@ -60,3 +65,6 @@ export const XIcon = styled(X)` | |||
| right: 18px; | |||
| } | |||
| `; | |||
| export const ReviewCard = styled(UserReviewsSingleCard)` | |||
| width: 335px; | |||
| `; | |||
| @@ -62,6 +62,7 @@ const EditCategory = (props) => { | |||
| } else closeModalHandler(); | |||
| }; | |||
| const handleSubmit = (values) => { | |||
| console.log(props); | |||
| dispatch( | |||
| fetchAdminMethod({ | |||
| type: props.type, | |||
| @@ -13,7 +13,7 @@ export const ReviewsBox = styled(Box)` | |||
| ${(props) => | |||
| props.profile && | |||
| css` | |||
| height: calc(100vh - 100px); | |||
| height: calc(100vh - 138px); | |||
| position: relative; | |||
| top: -15px; | |||
| `} | |||
| @@ -65,7 +65,11 @@ export const ReviewList = styled(List)` | |||
| border: 1px solid ${selectedTheme.colors.borderNormal}; | |||
| overflow-y: auto; | |||
| overflow-x: hidden; | |||
| max-height: ${(props) => (props.isProfileReviews ? "70vh" : "39vh")}; | |||
| max-height: ${(props) => (props.isProfileReviews ? "80vh" : "39vh")}; | |||
| @media (max-width: 600px) { | |||
| height: 450px; | |||
| } | |||
| /* overflow-y: auto; */ | |||
| &::-webkit-scrollbar { | |||
| @@ -75,6 +75,8 @@ const AdminSubcategoriesPage = () => { | |||
| type: SUBCATEGORIES_TYPE, | |||
| method: ADD_TYPE, | |||
| showSecondButton: true, | |||
| category, | |||
| categoryId: category?._id | |||
| }) | |||
| ); | |||
| }; | |||