mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14:40:50 +01:00
style changes to room visits
This commit is contained in:
parent
59dfb8d9b4
commit
0f7b13a8fc
@ -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());
|
||||
}
|
||||
|
@ -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,9 +33,11 @@ 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>);
|
||||
<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>);
|
||||
}
|
||||
|
||||
return (
|
||||
@ -42,22 +45,22 @@ export const ModToolsUserRoomVisitsView: FC<ModToolsUserRoomVisitsViewProps> = p
|
||||
<NitroCardHeaderView headerText={'User Visits'} onCloseClick={() => onCloseClick()} />
|
||||
<NitroCardContentView className="text-black">
|
||||
{roomVisitData &&
|
||||
<div className="row h-100 w-100 user-visits">
|
||||
<AutoSizer defaultWidth={400} defaultHeight={200}>
|
||||
{({ height, width }) =>
|
||||
{
|
||||
return (
|
||||
<List
|
||||
width={width}
|
||||
height={height}
|
||||
rowCount={roomVisitData.rooms.length}
|
||||
rowHeight={25}
|
||||
className={'roomvisits-container'}
|
||||
rowRenderer={RowRenderer}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
</AutoSizer>
|
||||
<div className="row h-100 w-100 user-visits">
|
||||
<AutoSizer defaultWidth={400} defaultHeight={200}>
|
||||
{({ height, width }) =>
|
||||
{
|
||||
return (
|
||||
<List
|
||||
width={width}
|
||||
height={height}
|
||||
rowCount={roomVisitData.rooms.length}
|
||||
rowHeight={30}
|
||||
className={'roomvisits-container'}
|
||||
rowRenderer={RowRenderer}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
</AutoSizer>
|
||||
</div>
|
||||
}
|
||||
</NitroCardContentView>
|
||||
|
Loading…
Reference in New Issue
Block a user