Skip to content

Commit

Permalink
Merge pull request #3007 from metabrainz/donate-prefill-username
Browse files Browse the repository at this point in the history
Donations: pre-fill username on metabrainz donation page
  • Loading branch information
MonkeyDo authored Oct 25, 2024
2 parents d6cf1e2 + fc601b6 commit 798d4c8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frontend/js/src/about/donations/Donate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import * as React from "react";
import { Link } from "react-router-dom";
import { COLOR_LB_GREEN } from "../../utils/constants";
import Blob from "../../home/Blob";
import GlobalAppContext from "../../utils/GlobalAppContext";

export default function Donate() {
const { currentUser } = React.useContext(GlobalAppContext);

return (
<div id="donations-page">
<Blob width={250} height={250} randomness={1.5} className="blob" />
Expand Down Expand Up @@ -39,7 +42,9 @@ export default function Donate() {
<h2>
<a
className="btn btn-success btn-lg btn-rounded"
href="https://metabrainz.org/donate?amount=5"
href={`https://metabrainz.org/donate?amount=5&editor=${
currentUser?.name ?? ""
}`}
target="_blank"
rel="noreferrer"
>
Expand Down Expand Up @@ -75,7 +80,9 @@ export default function Donate() {
<h2>
<a
className="btn btn-success btn-lg btn-rounded"
href="https://metabrainz.org/donate?amount=20"
href={`https://metabrainz.org/donate?amount=20&editor=${
currentUser?.name ?? ""
}`}
target="_blank"
rel="noreferrer"
>
Expand Down Expand Up @@ -119,7 +126,9 @@ export default function Donate() {
<h2>
<a
className="btn btn-success btn-lg btn-rounded"
href="https://metabrainz.org/donate?amount=50"
href={`https://metabrainz.org/donate?amount=50&editor=${
currentUser?.name ?? ""
}`}
target="_blank"
rel="noreferrer"
>
Expand Down

0 comments on commit 798d4c8

Please sign in to comment.