Fix gaining too much asc pts, reduce reputation gain in gangs.

This commit is contained in:
Olivier Gagnon
2021-06-18 16:53:42 -04:00
parent 8a78ee4cf6
commit 99263309ba
6 changed files with 30 additions and 10 deletions
+7 -1
View File
@@ -32,13 +32,18 @@ document.addEventListener("DOMContentLoaded", getGameContainer);
export function createPopup<T>(id: string, rootComponent: (props: T) => React.ReactElement, props: T): HTMLElement | null {
let container = document.getElementById(id);
if (container == null) {
function onClick(this: HTMLElement, event: MouseEvent): any {
//console.log(this.id);
}
container = createElement("div", {
class: "popup-box-container",
display: "flex",
id: id,
clickListener: onClick,
});
gameContainer.appendChild(container);
}
ReactDOM.render(<Popup content={rootComponent} id={id} props={props} />, container);
@@ -51,9 +56,10 @@ export function createPopup<T>(id: string, rootComponent: (props: T) => React.Re
*/
export function removePopup(id: string): void {
const content = document.getElementById(`${id}`);
if (content == null) { return; }
if (content == null) return;
ReactDOM.unmountComponentAtNode(content);
removeElementById(id);
removeElementById(`${id}-close`);
}