mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
updated more packets
This commit is contained in:
parent
e0fa891266
commit
e268a5a459
@ -1,4 +1,4 @@
|
|||||||
import { ChatRecordData, ModtoolRoomChatlogLine, UserProfileComposer } from '@nitrots/nitro-renderer';
|
import { ChatlineData, ChatRecordData, UserProfileComposer } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback } from 'react';
|
import { FC, useCallback } from 'react';
|
||||||
import { AutoSizer, CellMeasurer, CellMeasurerCache, List, ListRowProps, ListRowRenderer } from 'react-virtualized';
|
import { AutoSizer, CellMeasurer, CellMeasurerCache, List, ListRowProps, ListRowRenderer } from 'react-virtualized';
|
||||||
import { TryVisitRoom } from '../../../../api';
|
import { TryVisitRoom } from '../../../../api';
|
||||||
@ -33,7 +33,7 @@ export const ChatlogView: FC<ChatlogViewProps> = props =>
|
|||||||
|
|
||||||
const advancedRowRenderer: ListRowRenderer = (props: ListRowProps) =>
|
const advancedRowRenderer: ListRowRenderer = (props: ListRowProps) =>
|
||||||
{
|
{
|
||||||
let chatlogEntry: ModtoolRoomChatlogLine;
|
let chatlogEntry: ChatlineData;
|
||||||
let currentRecord: ChatRecordData;
|
let currentRecord: ChatRecordData;
|
||||||
let isRoomInfo = false;
|
let isRoomInfo = false;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ChatRecordData, GetRoomChatlogMessageComposer, ModtoolRoomChatlogEvent } from '@nitrots/nitro-renderer';
|
import { ChatRecordData, GetRoomChatlogMessageComposer, RoomChatlogEvent } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useEffect, useState } from 'react';
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
import { CreateMessageHook, SendMessageHook } from '../../../../../hooks/messages';
|
import { CreateMessageHook, SendMessageHook } from '../../../../../hooks/messages';
|
||||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../../layout';
|
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../../layout';
|
||||||
@ -16,7 +16,7 @@ export const ModToolsChatlogView: FC<ModToolsChatlogViewProps> = props =>
|
|||||||
SendMessageHook(new GetRoomChatlogMessageComposer(roomId));
|
SendMessageHook(new GetRoomChatlogMessageComposer(roomId));
|
||||||
}, [roomId]);
|
}, [roomId]);
|
||||||
|
|
||||||
const onModtoolRoomChatlogEvent = useCallback((event: ModtoolRoomChatlogEvent) =>
|
const onModtoolRoomChatlogEvent = useCallback((event: RoomChatlogEvent) =>
|
||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ export const ModToolsChatlogView: FC<ModToolsChatlogViewProps> = props =>
|
|||||||
setRoomChatlog(parser.data);
|
setRoomChatlog(parser.data);
|
||||||
}, [roomId, setRoomChatlog]);
|
}, [roomId, setRoomChatlog]);
|
||||||
|
|
||||||
CreateMessageHook(ModtoolRoomChatlogEvent, onModtoolRoomChatlogEvent);
|
CreateMessageHook(RoomChatlogEvent, onModtoolRoomChatlogEvent);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardView className="nitro-mod-tools-room-chatlog" simple={true}>
|
<NitroCardView className="nitro-mod-tools-room-chatlog" simple={true}>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { FriendlyTime, GetModeratorUserInfoMessageComposer, ModeratorUserInfoData, ModtoolUserInfoEvent } from '@nitrots/nitro-renderer';
|
import { FriendlyTime, GetModeratorUserInfoMessageComposer, ModeratorUserInfoData, ModeratorUserInfoEvent } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { LocalizeText } from '../../../../../api';
|
import { LocalizeText } from '../../../../../api';
|
||||||
import { ModToolsOpenUserChatlogEvent } from '../../../../../events/mod-tools/ModToolsOpenUserChatlogEvent';
|
import { ModToolsOpenUserChatlogEvent } from '../../../../../events/mod-tools/ModToolsOpenUserChatlogEvent';
|
||||||
@ -22,7 +22,7 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
|||||||
SendMessageHook(new GetModeratorUserInfoMessageComposer(userId));
|
SendMessageHook(new GetModeratorUserInfoMessageComposer(userId));
|
||||||
}, [ userId ]);
|
}, [ userId ]);
|
||||||
|
|
||||||
const onModtoolUserInfoEvent = useCallback((event: ModtoolUserInfoEvent) =>
|
const onModtoolUserInfoEvent = useCallback((event: ModeratorUserInfoEvent) =>
|
||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
|||||||
setUserInfo(parser.data);
|
setUserInfo(parser.data);
|
||||||
}, [setUserInfo, userId]);
|
}, [setUserInfo, userId]);
|
||||||
|
|
||||||
CreateMessageHook(ModtoolUserInfoEvent, onModtoolUserInfoEvent);
|
CreateMessageHook(ModeratorUserInfoEvent, onModtoolUserInfoEvent);
|
||||||
|
|
||||||
const userProperties = useMemo(() =>
|
const userProperties = useMemo(() =>
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ export const NotificationCenterMessageHandler: FC<INotificationCenterMessageHand
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
NotificationUtilities.handleModeratorMessage(parser.message, parser.link);
|
NotificationUtilities.handleModeratorMessage(parser.message, parser.url);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
CreateMessageHook(ModeratorMessageEvent, onModeratorMessageEvent);
|
CreateMessageHook(ModeratorMessageEvent, onModeratorMessageEvent);
|
||||||
|
Loading…
Reference in New Issue
Block a user