Skip to content

Commit

Permalink
Fixed build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
predatorray committed Dec 11, 2024
1 parent 60fc7f7 commit c39002f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@
font-size: 12px;
font-family: monospace;
text-align: left;
border-radius: 20px;
background-color: white;
padding: 2px 10px;
margin-bottom: 10px;
Expand Down Expand Up @@ -532,16 +531,16 @@
.message-bar .message.system-notification {
justify-content: center;
font-size: 10px;
color: #666;
color: #888;
}

.message-bar .message.system-notification::before {
content: '(';
content: '';
margin-right: auto;
}

.message-bar .message.system-notification::after {
content: ')';
content: '';
margin-left: auto;
}

Expand Down
10 changes: 6 additions & 4 deletions src/components/MessageBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ export default function MessageBar(props: {
onMessage?: (message: string) => void;
}) {
const {
playerId,
eventLogs,
messages,
onMessage,
} = props;
const eventsAndMessage: Array<EventLog | Message> = useMemo(() => {
const merged = [];
Expand Down Expand Up @@ -116,10 +118,10 @@ export default function MessageBar(props: {

const handleInputKeyUp: React.KeyboardEventHandler<HTMLInputElement> = useCallback(e => {
if (e.key === 'Enter' && inputValue) {
props.onMessage?.(inputValue);
onMessage?.(inputValue);
setInputValue('');
}
}, [inputValue]);
}, [inputValue, onMessage]);

const messagesDivRef = useRef<HTMLDivElement>(null);
useEffect(() => {
Expand All @@ -134,7 +136,7 @@ export default function MessageBar(props: {
<div className={collapsed ? "message-bar collapsed" : "message-bar"}>
<div className="title-bar" onClick={flipCollapsed}>
<div className="profile">
<PlayerAvatar playerId={props.playerId}/>
<PlayerAvatar playerId={playerId}/>
<a>Messages</a>
</div>
<div className="icon">
Expand All @@ -147,7 +149,7 @@ export default function MessageBar(props: {
: (
<div ref={messagesDivRef} className="messages">
{
eventsAndMessage.map((em, i) => <EventOrMessage key={i} myPlayerId={props.playerId} eventOrMessage={em}/>)
eventsAndMessage.map((em, i) => <EventOrMessage key={i} myPlayerId={playerId} eventOrMessage={em}/>)
}
</div>
)
Expand Down

0 comments on commit c39002f

Please sign in to comment.