All files / app/features/donations Donations.tsx

0% Statements 0/17
100% Branches 0/0
0% Functions 0/2
0% Lines 0/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207                                                                                                                                                                                                                                                                                                                                                                                                                             
import { Link, makeStyles, Typography } from "@material-ui/core";
import classNames from "classnames";
import HtmlMeta from "components/HtmlMeta";
import Markdown from "components/Markdown";
import Landscape from "features/donations/resources/landscape.jpeg";
import { DONATIONS, GLOBAL } from "i18n/namespaces";
import { Trans, useTranslation } from "next-i18next";
import CouchersLogo from "resources/CouchersLogo";
import { foundationRoute } from "routes";
 
import { BENEFACTOR_EMAIL } from "./constants";
import DonationsBox from "./DonationsBox";
 
const useStyles = makeStyles((theme) => ({
  donationsImage: {
    width: "100%",
    height: "100%",
    objectFit: "cover",
    opacity: 0.3,
  },
 
  donationsLogo: {
    "&&": {
      height: "72px",
      width: "initial",
    },
  },
 
  donationsWrapper: {
    display: "flex",
    justifyContent: "center",
    alignItems: "center",
    height: "120px",
  },
 
  donationsLogoHeader: {
    position: "absolute",
    zIndex: 1,
    maxWidth: "68.75rem",
    display: "flex",
    alignItems: "center",
    width: "100%",
    [theme.breakpoints.down("md")]: {
      maxWidth: "42rem",
    },
    [theme.breakpoints.down("sm")]: {
      margin: theme.spacing(0, 3),
    },
  },
 
  donationsLayoutPage: {
    display: "grid",
    gridTemplateColumns: "39rem 25.5rem",
    columnGap: theme.spacing(7.5),
    position: "relative",
    left: "50%",
    transform: "translateX(-50%)",
    justifyContent: "center",
    margin: theme.spacing(3, 0, 9, 0),
    [theme.breakpoints.down("md")]: {
      maxWidth: "42rem",
      display: "flex",
      flexDirection: "column",
    },
    [theme.breakpoints.down("sm")]: {
      maxWidth: "initial",
      left: "initial",
      transform: "initial",
      padding: theme.spacing(0, 3),
    },
  },
 
  donationsLogoText: {
    marginLeft: theme.spacing(2),
  },
 
  donationsText: {
    "&& li": {
      fontSize: "1rem",
    },
  },
  donationsLayoutText: {
    gridRow: "1 / 5",
    gridColumn: "1 / 2",
  },
 
  donationsLayoutBox: {
    gridRow: "1 / 2",
    gridColumn: "2 / 3",
  },
 
  donationsLayoutSecondaryTitle: {
    gridRow: "3 / 4",
    gridColumn: "2 / 3",
  },
 
  donationsLayoutBenefactorText: {
    gridRow: "2 / 3",
    gridColumn: "2 / 3",
  },
 
  donationsLayoutSecondaryText: {
    gridRow: "4 / 5",
    gridColumn: "2 / 3",
  },
 
  marginBottom2: {
    marginBottom: theme.spacing(2),
  },
 
  marginBottom3: {
    marginBottom: theme.spacing(3),
  },
 
  link: {
    fontSize: "0.75rem",
  },
}));
 
export default function Donations() {
  const classes = useStyles();
 
  const { t } = useTranslation([GLOBAL, DONATIONS]);
 
  return (
    <>
      <HtmlMeta title={t("donations:donate")} />
      <div className={classes.donationsWrapper}>
        <div className={classes.donationsLogoHeader}>
          <CouchersLogo className={classes.donationsLogo} />
          <div className={classes.donationsLogoText}>
            <Typography variant="h2">
              {t("donations:donations_banner.title")}
            </Typography>
            <Typography>{t("donations:donations_banner.body")}</Typography>
          </div>
        </div>
        <img className={classes.donationsImage} src={Landscape.src} alt="" />
      </div>
      <section className={classes.donationsLayoutPage}>
        <div
          className={classNames(
            classes.marginBottom2,
            classes.donationsLayoutBox
          )}
        >
          <DonationsBox />
        </div>
 
        <div className={classes.donationsLayoutBenefactorText}>
          <Typography className={classes.marginBottom3} variant="body2">
            <Trans t={t} i18nKey="donations:donations_info">
              Your donation goes to
              <Link className={classes.link} href={foundationRoute}>
                {{ legal_name: t("global:legal_name") }}
              </Link>
              , a U.S. 501(c)(3) non-profit that operates the Couchers.org
              service and supports the project. Donations are tax exempt, our
              EIN is 87-1734577.
            </Trans>
          </Typography>
 
          <Typography className={classes.marginBottom3} variant="body2">
            <Trans t={t} i18nKey="donations:benefactor_contact">
              If you wish to contribute over $1000, please contact us at
              <Link
                className={classes.link}
                href={`mailto:${BENEFACTOR_EMAIL}`}
              >
                {{ email: BENEFACTOR_EMAIL }}
              </Link>
              for us to arrange a lower fee transfer.
            </Trans>
          </Typography>
        </div>
        <div
          className={classNames(
            classes.marginBottom3,
            classes.donationsLayoutText
          )}
        >
          <Typography variant="h1">{t("donations:donations_title")}</Typography>
          <Markdown
            className={classes.donationsText}
            source={t("donations:donations_text")}
          />
        </div>
 
        <Typography
          className={classes.donationsLayoutSecondaryTitle}
          variant="h2"
        >
          {t("donations:donations_title2")}
        </Typography>
 
        <Markdown
          className={classNames(
            classes.donationsText,
            classes.donationsLayoutSecondaryText
          )}
          source={t("donations:donations_text2")}
        />
      </section>
    </>
  );
}