mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 19:43:49 +01:00
commit
701e165920
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 {
|
||||
|
@ -70,12 +70,6 @@ export function FactionRoot(props: IProps): React.ReactElement {
|
||||
function rerender(): void {
|
||||
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];
|
||||
|
Loading…
Reference in New Issue
Block a user