Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ReviewerProfile.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import useIsMobile from "../../../../hooks/useIsMobile";
  4. import { getImageUrl, variants } from "../../../../util/helpers/imageUrlGetter";
  5. import {
  6. ProfileContainer,
  7. ProfileImage,
  8. ProfileImageContainer,
  9. ProfileName,
  10. } from "./ReviewerProfile.styled";
  11. import history from "../../../../store/utils/history";
  12. import { replaceInRoute } from "../../../../util/helpers/routeHelpers";
  13. import { PROFILE_PAGE } from "../../../../constants/pages";
  14. const ReviewerProfile = (props) => {
  15. const { isMobile } = useIsMobile();
  16. const routeToUser = () => {
  17. history.push(replaceInRoute(PROFILE_PAGE, {
  18. idProfile: props.userId
  19. }))
  20. }
  21. return (
  22. <ProfileContainer>
  23. <ProfileImageContainer>
  24. <ProfileImage
  25. onClick={routeToUser}
  26. src={getImageUrl(props.profileImage, variants.reviewCard, isMobile)}
  27. />
  28. </ProfileImageContainer>
  29. <ProfileName onClick={routeToUser}>{props.profileName}</ProfileName>
  30. </ProfileContainer>
  31. );
  32. };
  33. ReviewerProfile.propTypes = {
  34. profileName: PropTypes.string,
  35. profileImage: PropTypes.string,
  36. userId: PropTypes.string,
  37. };
  38. export default ReviewerProfile;