mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-22 22:30:52 +01:00
Add bot name & motto max length
This commit is contained in:
parent
f398c32ed1
commit
17262d502a
@ -14,6 +14,8 @@
|
|||||||
"camera.publish.disabled": false,
|
"camera.publish.disabled": false,
|
||||||
"hc.disabled": false,
|
"hc.disabled": false,
|
||||||
"badge.descriptions.enabled": true,
|
"badge.descriptions.enabled": true,
|
||||||
|
"motto.max.length": 38,
|
||||||
|
"bot.name.max.length": 15,
|
||||||
"hotelview": {
|
"hotelview": {
|
||||||
"show.avatar": true,
|
"show.avatar": true,
|
||||||
"widgets": {
|
"widgets": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BotCommandConfigurationEvent, BotRemoveComposer, BotSkillSaveComposer, RequestBotCommandConfigurationComposer, RoomObjectCategory, RoomObjectType } from '@nitrots/nitro-renderer';
|
import { BotCommandConfigurationEvent, BotRemoveComposer, BotSkillSaveComposer, RequestBotCommandConfigurationComposer, RoomObjectCategory, RoomObjectType } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useEffect, useState } from 'react';
|
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 { Button, Column, Flex, Text } from '../../../../common';
|
||||||
import { UseMessageEventHook } from '../../../../hooks';
|
import { UseMessageEventHook } from '../../../../hooks';
|
||||||
import { useRoomContext } from '../../RoomContext';
|
import { useRoomContext } from '../../RoomContext';
|
||||||
@ -182,7 +182,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
|
|||||||
{ (mode === MODE_CHANGE_NAME) &&
|
{ (mode === MODE_CHANGE_NAME) &&
|
||||||
<Column className="menu-item" onClick={ null } gap={ 1 }>
|
<Column className="menu-item" onClick={ null } gap={ 1 }>
|
||||||
<Text variant="white">{ LocalizeText('bot.skill.name.configuration.new.name') }</Text>
|
<Text variant="white">{ LocalizeText('bot.skill.name.configuration.new.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ newName } onChange={ event => setNewName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ newName } maxLength={ GetConfiguration<number>('bot.name.max.length', 15) } onChange={ event => setNewName(event.target.value) } />
|
||||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||||
<Button fullWidth variant="secondary" onClick={ event => processAction(null) }>{ LocalizeText('cancel') }</Button>
|
<Button fullWidth variant="secondary" onClick={ event => processAction(null) }>{ LocalizeText('cancel') }</Button>
|
||||||
<Button fullWidth variant="success" onClick={ event => processAction('save_bot_name') }>{ LocalizeText('save') }</Button>
|
<Button fullWidth variant="success" onClick={ event => processAction('save_bot_name') }>{ LocalizeText('save') }</Button>
|
||||||
@ -191,7 +191,7 @@ export const AvatarInfoWidgetRentableBotView: FC<AvatarInfoWidgetRentableBotView
|
|||||||
{ (mode === MODE_CHANGE_MOTTO) &&
|
{ (mode === MODE_CHANGE_MOTTO) &&
|
||||||
<Column className="menu-item" onClick={ null } gap={ 1 }>
|
<Column className="menu-item" onClick={ null } gap={ 1 }>
|
||||||
<Text variant="white">{ LocalizeText('bot.skill.name.configuration.new.motto') }</Text>
|
<Text variant="white">{ LocalizeText('bot.skill.name.configuration.new.motto') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ newMotto } onChange={ event => setNewMotto(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ newMotto } maxLength={ GetConfiguration<number>('motto.max.legnth', 38) } onChange={ event => setNewMotto(event.target.value) } />
|
||||||
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
<Flex alignItems="center" justifyContent="between" gap={ 1 }>
|
||||||
<Button fullWidth variant="secondary" onClick={ event => processAction(null) }>{ LocalizeText('cancel') }</Button>
|
<Button fullWidth variant="secondary" onClick={ event => processAction(null) }>{ LocalizeText('cancel') }</Button>
|
||||||
<Button fullWidth variant="success" onClick={ event => processAction('save_bot_motto') }>{ LocalizeText('save') }</Button>
|
<Button fullWidth variant="success" onClick={ event => processAction('save_bot_motto') }>{ LocalizeText('save') }</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user