/* Stolen word display in claim area */
.claimed-word {
+ position: relative;
display: inline-flex;
align-items: center;
gap: 2px;
- margin-right: 0.5em;
margin-bottom: 4px;
}
-.claimed-word .separator {
+.claimed-word .remove-word-btn {
+ position: absolute;
+ top: -8px;
+ right: -8px;
+ width: 18px;
+ height: 18px;
+ line-height: 18px;
+ text-align: center;
+ font-size: 11px;
+ background: #888;
+ color: white;
+ border-radius: 50%;
+ cursor: pointer;
+}
+
+.separator {
font-size: 18px;
font-weight: bold;
color: #666;
- margin: 0 2px;
+ margin: 0 4px;
}
/* Player word areas */
{claimed_words.length > 0 ? (
<div>
- {claimed_words.map(cw => (
+ {claimed_words.map((cw, i) => [
+ i > 0 ? <span key={"sep" + cw.word_id}
+ className="separator">+</span> : null,
<span key={cw.word_id} className="claimed-word">
- {cw.word_obj.word.split("").map((ch, i) => (
- <Tile key={i} letter={ch} />
+ {cw.word_obj.word.split("").map((ch, j) => (
+ <Tile key={j} letter={ch} />
))}
- <span className="separator">+</span>
- <span style={{ cursor: "pointer", fontSize: "0.9em",
- color: "#888" }}
+ <span className="remove-word-btn"
onClick={() => this.return_word(cw.word_id)}>
✕
</span>
</span>
- ))}
+ ])}
</div>
) : null}