-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move stuff to billetbank * new modules * refactor 2 electric boogaloo * why do you do this to me, prettier?
- Loading branch information
Showing
5 changed files
with
214 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from "react"; | ||
|
||
/*This function is probably the most complicated code in the ADR. Essentially, it takes inputArray and headerTitles, and iterates through the first layer of inputArray's arrays | ||
which in this case is the battalion level. At the battalion level, it creates a table row for each company, adding the company title (defined in BilletBank.js) and unit strength counter. | ||
After the title and counter are created for the company level, the lists themselves for each company are created, which are the second layer of arrays. The lists themselves contain | ||
milpac link, name and rank, and position title.*/ | ||
|
||
function ArrayMap(props) { | ||
let inputArray = props.inputArray; | ||
|
||
return ( | ||
<table> | ||
<tbody> | ||
{inputArray.map((subArray, index) => ( | ||
<React.Fragment key={`fragment-${index}`}> | ||
<tr key={`header-${index}`}> | ||
<th className="Subtitle" align="left"> | ||
{props.headerTitles[index]} | ||
</th> | ||
<th align="right" className="Counter"> | ||
Unit Strength: {inputArray[index].length} | ||
</th> | ||
</tr> | ||
{subArray.map((item, subIndex) => ( | ||
<tr key={item.listKey}> | ||
<td> | ||
<a href={"https://7cav.us/rosters/profile/" + item.itemKey}> | ||
{item.fullName} | ||
</a> | ||
</td> | ||
<td>{item.position.positionTitle}</td> | ||
</tr> | ||
))} | ||
</React.Fragment> | ||
))} | ||
</tbody> | ||
</table> | ||
); | ||
} | ||
|
||
export default ArrayMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.