First commit to the new repository

:
This commit is contained in:
Daniel Ledda
2020-05-10 15:10:12 +02:00
commit d99d7cbfec
49 changed files with 10784 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import React, {ReactNode} from "react";
import {LocaleContext} from "../static/strings";
import KadiCell from "./KadiCell";
import {FieldType} from "../static/enums";
import {Icon} from "semantic-ui-react";
import {CellScores} from "./KadiBoard";
interface KadiGrandTotalRowProps {
showResults: boolean;
scores: CellScores;
toggleShowResults(): void;
}
const KadiGrandTotalRow: React.FunctionComponent<KadiGrandTotalRowProps> = ({ showResults, toggleShowResults, scores}) => {
const cells: ReactNode[] = [];
const Locale = React.useContext(LocaleContext).strings;
for (const playerId in scores) {
cells.push((
<KadiCell
key={"cell_grandtotal_" + playerId}
location={{blockId: "global", cellId: "grandTotal"}}
fieldType={FieldType.globalTotal}
playerId={playerId}
value={scores[playerId]}
onCellEdit={() => {}}
/>
));
}
return (
<tr
key={"rowContGrandTotal"}
className={"kadiRow " + FieldType.globalTotal + (showResults ? "" : " hideResults")}
>
<td
onClick={toggleShowResults}
className="kadiCell rowLabelCell"
>
{Locale.rowLabels.globalTotal}
<Icon className={"showResultsIcon"} name={showResults ? "hide" : "unhide"} />
</td>
{cells}
</tr>
);
};
export default KadiGrandTotalRow;