fix donation

This commit is contained in:
Olivier Gagnon 2021-09-22 12:49:29 -04:00
parent 3a7c64872a
commit c1945ab12e
5 changed files with 16 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -52,6 +52,7 @@ export function DonateOption(props: IProps): React.ReactElement {
const amt = numeralWrapper.parseMoney(event.target.value);
if (event.target.value === "" || isNaN(amt)) setDonateAmt(null);
else setDonateAmt(amt);
console.log('set')
}
function donate(): void {

@ -66,16 +66,10 @@ const GangNames = [
];
export function FactionRoot(props: IProps): React.ReactElement {
const setRerender = useState(false)[1];
const setRerender = useState(false)[1];
function rerender(): void {
setRerender((old) => !old);
setRerender((old) => !old);
}
useEffect(() => {
const id = setInterval(rerender, 1000);
return () => clearInterval(id);
}, []);
const faction = props.faction;
const player = use.Player();

@ -2,7 +2,7 @@
* React component for general information about the faction. This includes the
* factions "motto", reputation, favor, and gameplay instructions
*/
import * as React from "react";
import React, {useState, useEffect} from "react";
import { Faction } from "../../Faction/Faction";
import { FactionInfo } from "../../Faction/FactionInfo";
@ -34,6 +34,16 @@ const useStyles = makeStyles((theme: Theme) =>
);
export function Info(props: IProps): React.ReactElement {
const setRerender = useState(false)[1];
function rerender(): void {
setRerender((old) => !old);
}
useEffect(() => {
const id = setInterval(rerender, 1000);
return () => clearInterval(id);
}, []);
const classes = useStyles();
const favorGain = props.faction.getFavorGain()[0];