Removed all DOM id

This commit is contained in:
Olivier Gagnon 2021-06-17 18:03:58 -04:00
parent 31cf02e8e4
commit 94ea0d253c
6 changed files with 10 additions and 19 deletions

@ -32,8 +32,7 @@ export function GangMemberList(props: IProps): React.ReactElement {
setFilter(event.target.value); setFilter(event.target.value);
} }
const members = props.gang.members.filter((member: GangMember) => const members = props.gang.members.filter((member: GangMember) => member.name.indexOf(filter) > -1 || member.task.indexOf(filter) > -1);
member.name.indexOf(filter) > -1 || member.task.indexOf(filter) > -1);
return (<> return (<>
<RecruitButton <RecruitButton

@ -6,7 +6,7 @@ import React from "react";
import { dialogBoxCreate } from "../../../utils/DialogBox"; import { dialogBoxCreate } from "../../../utils/DialogBox";
import { formatNumber } from "../../../utils/StringHelperFunctions"; import { formatNumber } from "../../../utils/StringHelperFunctions";
import { numeralWrapper } from "../../ui/numeralFormat"; import { numeralWrapper } from "../../ui/numeralFormat";
import { createPopup, removePopup } from "../../ui/React/createPopup"; import { createPopup } from "../../ui/React/createPopup";
import { Gang } from "../Gang"; import { Gang } from "../Gang";
import { GangMember } from "../GangMember"; import { GangMember } from "../GangMember";
import { AscensionPopup } from "./AscensionPopup"; import { AscensionPopup } from "./AscensionPopup";

@ -45,7 +45,7 @@ function GangMemberUpgradePanel(props: IPanelProps): React.ReactElement {
</div>); </div>);
} }
function upgradeButton(upg: GangMemberUpgrade, left: boolean = false): React.ReactElement { function upgradeButton(upg: GangMemberUpgrade, left = false): React.ReactElement {
function onClick(): void { function onClick(): void {
props.member.buyUpgrade(upg, props.player, props.gang); props.member.buyUpgrade(upg, props.player, props.gang);
setRerender(old => !old); setRerender(old => !old);
@ -131,8 +131,7 @@ export function GangMemberUpgradePopup(props: IProps): React.ReactElement {
discounts. discounts.
</span> </span>
</p> </p>
{props.gang.members.map((member: GangMember) => {props.gang.members.map((member: GangMember) => <GangMemberUpgradePanel
<GangMemberUpgradePanel
key={member.name} key={member.name}
player={props.player} player={props.player}
gang={props.gang} gang={props.gang}

@ -14,10 +14,5 @@ export function TaskDescription(props: IProps): React.ReactElement {
const task = GangMemberTasks[props.member.task]; const task = GangMemberTasks[props.member.task];
const desc = task ? task.desc: GangMemberTasks["Unassigned"].desc; const desc = task ? task.desc: GangMemberTasks["Unassigned"].desc;
return (<> return (<p className="inline" dangerouslySetInnerHTML={{__html: desc}} />);
<p className="inline"
id={`${props.member.name}-gang-member-task-description`}
dangerouslySetInnerHTML={{__html: desc}}>
</p>
</>);
} }

@ -38,11 +38,11 @@ export function TaskSelector(props: IProps): React.ReactElement {
<select <select
onChange={onChange} onChange={onChange}
className="dropdown" className="dropdown"
id={`${props.member.name}-gang-member-task-selector`}
value={currentTask}> value={currentTask}>
<option key={0} value={"---"}>---</option> <option key={0} value={"---"}>---</option>
{tasks.map((task: string, i: number) => <option key={i+1} value={task}>{task}</option>)} {tasks.map((task: string, i: number) =>
<option key={i+1} value={task}>{task}</option>)}
</select> </select>
<div id={`${name}-gang-member-gain-info`}>{StatsTable(data, null)}</div> <div>{StatsTable(data, null)}</div>
</>); </>);
} }

@ -80,8 +80,7 @@ export function TerritorySubpage(props: IProps): React.ReactElement {
id="warfare" id="warfare"
type="checkbox" type="checkbox"
style={{display: "inline-block", margin: "2px"}} style={{display: "inline-block", margin: "2px"}}
onChange={(event)=> onChange={(event)=> props.gang.territoryWarfareEngaged = event.target.checked}/>
props.gang.territoryWarfareEngaged = event.target.checked}/>
<label <label
htmlFor="warfare" htmlFor="warfare"
className="tooltip" className="tooltip"
@ -108,8 +107,7 @@ export function TerritorySubpage(props: IProps): React.ReactElement {
id="notify" id="notify"
type="checkbox" type="checkbox"
style={{display: "inline-block", margin: "2px"}} style={{display: "inline-block", margin: "2px"}}
onChange={(event)=> onChange={(event)=> props.gang.notifyMemberDeath = event.target.checked}/>
props.gang.notifyMemberDeath = event.target.checked}/>
<label htmlFor="warfare" className="tooltip" style={{color: "white", display: 'inline-block'}}> <label htmlFor="warfare" className="tooltip" style={{color: "white", display: 'inline-block'}}>
Notify about Gang Member Deaths Notify about Gang Member Deaths
<span className="tooltiptext" style={{display: "inline-block"}}> <span className="tooltiptext" style={{display: "inline-block"}}>