Skip to content

Commit

Permalink
feat: turn message into success
Browse files Browse the repository at this point in the history
  • Loading branch information
bbb169 committed Oct 22, 2023
1 parent 4ed9186 commit 4b96735
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pages/playRoom/hooks/usePlayersInfo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { message } from 'antd';
import { useEffect, useState } from 'react';
import { Socket } from 'socket.io-client';
import { PlayerInfoType, VictoryInfo } from '../type.js';
Expand Down Expand Up @@ -31,6 +32,14 @@ export default function usePlayersInfo (socket: Socket | void): [PlayerInfoType[

setVictoryPlayers(victoryPlayers);
});

socket.on('playersCalledRes', (playersCalledRes: [PlayerInfoType, string][]) => {
console.log('playersCalledRes', playersCalledRes);

playersCalledRes.forEach(([player, info]) => {
message.success(`${player.name} ${info}`);
});
});
}
}, [socket]);

Expand Down

0 comments on commit 4b96735

Please sign in to comment.