Merge branch 'feature/mod-tools' of https://github.com/billsonnn/nitro-react into feature/mod-tools

This commit is contained in:
Bill 2021-10-20 02:45:06 -04:00
commit 1ba006f687
2 changed files with 25 additions and 28 deletions

View File

@ -184,9 +184,7 @@ export const ModToolsView: FC<ModToolsViewProps> = props =>
return;
}
const itemIndex = openRooms.indexOf(currentRoomId);
if(itemIndex > -1)
if(openRooms.indexOf(currentRoomId) > -1)
{
handleClick('close_room', currentRoomId.toString());
}
@ -217,9 +215,7 @@ export const ModToolsView: FC<ModToolsViewProps> = props =>
return;
}
const itemIndex = openRoomChatlogs.indexOf(currentRoomId);
if(itemIndex > -1)
if(openRoomChatlogs.indexOf(currentRoomId) > -1)
{
handleClick('close_room_chatlog', currentRoomId.toString());
}
@ -255,9 +251,7 @@ export const ModToolsView: FC<ModToolsViewProps> = props =>
return;
}
const itemIndex = openUserInfo.indexOf(userId);
if(itemIndex > -1)
if(openUserInfo.indexOf(userId) > -1)
{
handleClick('close_user_info', userId.toString());
}

View File

@ -1,6 +1,7 @@
import { ModtoolReceivedRoomsUserEvent, ModtoolRequestUserRoomsComposer, ModtoolRoomVisitedData } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useState } from 'react';
import { AutoSizer, List, ListRowProps, ListRowRenderer } from 'react-virtualized';
import { TryVisitRoom } from '../../../../../api';
import { CreateMessageHook, SendMessageHook } from '../../../../../hooks';
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../../layout';
import { ModToolsUserRoomVisitsViewProps } from './ModToolsUserRoomVisitsView.types';
@ -32,8 +33,10 @@ export const ModToolsUserRoomVisitsView: FC<ModToolsUserRoomVisitsViewProps> = p
const item = roomVisitData.rooms[props.index];
return (
<div style={props.style} key={props.key} className="room-visit">
{item.enterHour}:{item.enterMinute} <b>Room:</b> {item.roomName}
<div style={props.style} key={props.key} className="row room-visit">
<div className="col-auto text-center">{item.enterHour.toString().padStart(2, '0')}:{item.enterMinute.toString().padStart(2, '0')}</div>
<div className="col-7"><span className="fw-bold">Room: </span>{item.roomName}</div>
<button className="btn btn-sm btn-link col-sm-auto fw-bold" onClick={() => TryVisitRoom(item.roomId)}>Visit Room</button>
</div>);
}
@ -51,7 +54,7 @@ export const ModToolsUserRoomVisitsView: FC<ModToolsUserRoomVisitsViewProps> = p
width={width}
height={height}
rowCount={roomVisitData.rooms.length}
rowHeight={25}
rowHeight={30}
className={'roomvisits-container'}
rowRenderer={RowRenderer}
/>