mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-19 05:46:27 +01:00
Add motto max length
This commit is contained in:
parent
924ea0de68
commit
4f27d0b82c
@ -25,7 +25,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
|
|||||||
|
|
||||||
const saveMotto = (motto: string) =>
|
const saveMotto = (motto: string) =>
|
||||||
{
|
{
|
||||||
if(!isEditingMotto || (motto.length > 38)) return;
|
if(!isEditingMotto || (motto.length > GetConfiguration<number>('motto.max.legnth', 38))) return;
|
||||||
|
|
||||||
widgetHandler.processWidgetMessage(new RoomWidgetChangeMottoMessage(motto));
|
widgetHandler.processWidgetMessage(new RoomWidgetChangeMottoMessage(motto));
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
|
|||||||
{ !isEditingMotto &&
|
{ !isEditingMotto &&
|
||||||
<Text fullWidth pointer wrap textBreak small variant="white" onClick={ event => setIsEditingMotto(true) }>{ motto } </Text> }
|
<Text fullWidth pointer wrap textBreak small variant="white" onClick={ event => setIsEditingMotto(true) }>{ motto } </Text> }
|
||||||
{ isEditingMotto &&
|
{ isEditingMotto &&
|
||||||
<input type="text" className="motto-input" maxLength={ 38 } value={ motto } onChange={ event => setMotto(event.target.value) } onBlur={ onMottoBlur } onKeyDown={ onMottoKeyDown } autoFocus={ true } /> }
|
<input type="text" className="motto-input" maxLength={ GetConfiguration<number>('motto.max.legnth', 38) } value={ motto } onChange={ event => setMotto(event.target.value) } onBlur={ onMottoBlur } onKeyDown={ onMottoKeyDown } autoFocus={ true } /> }
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex> }
|
</Flex> }
|
||||||
</Flex>
|
</Flex>
|
||||||
|
Loading…
Reference in New Issue
Block a user