From 17262d502a74d6f480d4c7b478a4446ceca358d9 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 23 Mar 2022 04:48:33 -0400 Subject: [PATCH] Add bot name & motto max length --- public/ui-config.json.example | 2 ++ .../widgets/avatar-info/AvatarInfoWidgetRentableBotView.tsx | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/ui-config.json.example b/public/ui-config.json.example index d9934672..0497155b 100644 --- a/public/ui-config.json.example +++ b/public/ui-config.json.example @@ -14,6 +14,8 @@ "camera.publish.disabled": false, "hc.disabled": false, "badge.descriptions.enabled": true, + "motto.max.length": 38, + "bot.name.max.length": 15, "hotelview": { "show.avatar": true, "widgets": { diff --git a/src/components/room/widgets/avatar-info/AvatarInfoWidgetRentableBotView.tsx b/src/components/room/widgets/avatar-info/AvatarInfoWidgetRentableBotView.tsx index 1aa4f8fd..0822cff9 100644 --- a/src/components/room/widgets/avatar-info/AvatarInfoWidgetRentableBotView.tsx +++ b/src/components/room/widgets/avatar-info/AvatarInfoWidgetRentableBotView.tsx @@ -1,6 +1,6 @@ import { BotCommandConfigurationEvent, BotRemoveComposer, BotSkillSaveComposer, RequestBotCommandConfigurationComposer, RoomObjectCategory, RoomObjectType } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; -import { GetNitroInstance, LocalizeText, RoomWidgetUpdateInfostandRentableBotEvent, RoomWidgetUpdateRentableBotChatEvent, SendMessageComposer } from '../../../../api'; +import { GetConfiguration, GetNitroInstance, LocalizeText, RoomWidgetUpdateInfostandRentableBotEvent, RoomWidgetUpdateRentableBotChatEvent, SendMessageComposer } from '../../../../api'; import { Button, Column, Flex, Text } from '../../../../common'; import { UseMessageEventHook } from '../../../../hooks'; import { useRoomContext } from '../../RoomContext'; @@ -182,7 +182,7 @@ export const AvatarInfoWidgetRentableBotView: FC { LocalizeText('bot.skill.name.configuration.new.name') } - setNewName(event.target.value) } /> + ('bot.name.max.length', 15) } onChange={ event => setNewName(event.target.value) } /> @@ -191,7 +191,7 @@ export const AvatarInfoWidgetRentableBotView: FC { LocalizeText('bot.skill.name.configuration.new.motto') } - setNewMotto(event.target.value) } /> + ('motto.max.legnth', 38) } onChange={ event => setNewMotto(event.target.value) } />