All files / app/features/auth/donations ManageDonations.tsx

0% Statements 0/11
100% Branches 0/0
0% Functions 0/2
0% Lines 0/11

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                                                                     
import { Typography } from "@mui/material";
import Button from "components/Button";
import { DONATIONS } from "i18n/namespaces";
import { useRouter } from "next/router";
import { useTranslation } from "next-i18next";
import { service } from "service";
 
type ManageDonationsProps = {
  className?: string;
};
 
export default function ManageDonations({ className }: ManageDonationsProps) {
  const { t } = useTranslation([DONATIONS]);
 
  const router = useRouter();
 
  const goToPortal = async () => {
    router.push(await service.donations.getDonationPortalLink());
  };
 
  return (
    <div className={className}>
      <Typography variant="h2">{t("settings_fragment.title")}</Typography>
      <Typography variant="body1" gutterBottom>
        {t("settings_fragment.description")}
      </Typography>
      <Typography variant="body1">
        <Button onClick={goToPortal}>
          {t("settings_fragment.button_text")}
        </Button>
      </Typography>
    </div>
  );
}