Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

BigProfileCard.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import {
  4. ProfileCardContainer,
  5. ProfileCardWrapper,
  6. ProfileInfoContainer,
  7. CheckButton,
  8. } from "./BigProfileCard.styled";
  9. import ProfileMainInfo from "../ProfileMainInfo/ProfileMainInfo";
  10. import ProfileContact from "../ProfileContact/ProfileContact";
  11. import selectedTheme from "../../../../themes";
  12. import { useTranslation } from "react-i18next";
  13. import history from "../../../../store/utils/history";
  14. import { replaceInRoute } from "../../../../util/helpers/routeHelpers";
  15. import { ADMIN_SINGLE_USER_PAGE } from "../../../../constants/pages";
  16. import ProfileControl from "../ProfileControl/ProfileControl";
  17. const BigProfileCard = (props) => {
  18. const { t } = useTranslation();
  19. const goToUser = () => {
  20. history.push(
  21. replaceInRoute(ADMIN_SINGLE_USER_PAGE, {
  22. profileId: props.profile?._id,
  23. })
  24. );
  25. };
  26. return (
  27. <ProfileCardContainer halfwidth={props.halfwidth} onClick={goToUser}>
  28. <ProfileCardWrapper variant="outlined">
  29. {/* Profile Control (edit, remove, block, unblock) */}
  30. <ProfileControl profile={props.profile} isAdmin bigProfileCard />
  31. <ProfileInfoContainer>
  32. {/* Profile Main Info */}
  33. <ProfileMainInfo profile={props.profile} bigProfileCard isAdmin />
  34. {/* Profile Contact */}
  35. <ProfileContact profile={props.profile} bigProfileCard isAdmin />
  36. </ProfileInfoContainer>
  37. <CheckButton
  38. halfwidth={props.halfwidth}
  39. variant={"outlined"}
  40. buttoncolor={selectedTheme.colors.primaryPurple}
  41. textcolor={selectedTheme.colors.primaryPurple}
  42. style={{ fontWeight: "600" }}
  43. onClick={goToUser}
  44. >
  45. {t("admin.users.checkProfile")}
  46. </CheckButton>
  47. </ProfileCardWrapper>
  48. </ProfileCardContainer>
  49. );
  50. };
  51. BigProfileCard.propTypes = {
  52. profile: PropTypes.any,
  53. halfwidth: PropTypes.bool,
  54. isAdmin: PropTypes.bool,
  55. };
  56. export default BigProfileCard;