, dispatch: TileDispatch}) {
const elements = props.cellTypes.map((ct, i) => {
- let className: string;
- switch (ct) {
- case CellType.Normal:
- className = "grid-spot-normal"
- break;
- case CellType.DoubleWord:
- className = "grid-spot-double-word"
- break;
- case CellType.DoubleLetter:
- className = "grid-spot-double-letter"
- break;
- case CellType.TripleLetter:
- className = "grid-spot-triple-letter"
- break;
- case CellType.TripleWord:
- className = "grid-spot-triple-word"
- break;
- case CellType.Start:
- className = "grid-spot-start"
- break;
+ const {className, text} = cell_type_to_details(ct);
- }
-
- return ;
+ return
+ {text}
+
+
;
});
+ for (let letter of props.playerLetters) {
+ if (letter.location === LocationType.GRID) {
+ const ct = props.cellTypes[letter.index];
+ const {className, text} = cell_type_to_details(ct);
+
+ elements[letter.index] =
+
+ }
+ location={{location: LocationType.GRID, index: letter.index}}
+ dispatch={props.dispatch} />
+
;
+
+
+ }
+ }
+
return
{elements}
diff --git a/ui/src/style.less b/ui/src/style.less
index f97ce15..8805762 100644
--- a/ui/src/style.less
+++ b/ui/src/style.less
@@ -23,6 +23,25 @@
user-select: none;
}
+.grid-spot {
+ font-size: 12px;
+ text-align: center;
+ background-color: #bbb59d;
+ position: relative;
+
+ span {
+ vertical-align: middle;
+ z-index: 0;
+ }
+
+ .tileSpot {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 1;
+ }
+}
+
.grid-spot-normal{
}
@@ -46,12 +65,16 @@
.grid-spot-start {
background-color: #f9b4a5;
font-size: @tile-star-size;
+
+ span { // undo the vertical align other cells have
+ vertical-align: unset;
+ }
}
.tileSpot {
- height: 100%;
- width: 100%;
+ height: @tile-width;
+ width: @tile-width;
}
.letter {