chat messages styling
This commit is contained in:
@@ -447,7 +447,22 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) {
|
|||||||
>
|
>
|
||||||
{chatMessages.map((m, i) => (
|
{chatMessages.map((m, i) => (
|
||||||
<li className="max-w-[30rem]" key={i}>
|
<li className="max-w-[30rem]" key={i}>
|
||||||
{m.author.name}: {m.message}
|
<span
|
||||||
|
className={
|
||||||
|
!m.author.id && m.author.name === "server" ? "bg-base-content p-2" : ""
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{m.author.id && (
|
||||||
|
<span>
|
||||||
|
<span className="font-bold">{m.author.name}</span>:{" "}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<span
|
||||||
|
className={!m.author.id && m.author.name === "server" ? "text-base-300" : ""}
|
||||||
|
>
|
||||||
|
{m.message}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export function initSocket(
|
|||||||
winnerSide?: string;
|
winnerSide?: string;
|
||||||
}) => {
|
}) => {
|
||||||
const m = {
|
const m = {
|
||||||
author: { name: "game" }
|
author: { name: "server" }
|
||||||
} as Message;
|
} as Message;
|
||||||
|
|
||||||
if (reason === "checkmate") {
|
if (reason === "checkmate") {
|
||||||
|
|||||||
Reference in New Issue
Block a user