Update navigator-creator

This commit is contained in:
MyNameIsBatman 2022-02-22 23:14:32 -03:00
parent 13da75c105
commit 05580436eb

View File

@ -65,57 +65,61 @@ export const NavigatorRoomCreatorView: FC<{}> = props =>
return ( return (
<Column overflow="hidden"> <Column overflow="hidden">
<Grid fullHeight={ false }> <Grid>
<Column size={ 6 } gap={ 1 }> <Column size={ 6 }>
<Text>{ LocalizeText('navigator.createroom.roomnameinfo') }</Text> <Column gap={ 1 }>
<input type="text" className="form-control form-control-sm" onChange={ event => setName(event.target.value) } /> <Text>{ LocalizeText('navigator.createroom.roomnameinfo') }</Text>
<input type="text" className="form-control form-control-sm" onChange={ event => setName(event.target.value) } />
</Column>
<Column gap={ 1 }>
<Text>{ LocalizeText('navigator.category') }</Text>
<select className="form-select form-select-sm" onChange={ event => setCategory(Number(event.target.value)) }>
{ categories && categories.map(category =>
{
return <option key={ category.id } value={ category.id }>{ LocalizeText(category.name) }</option>
}) }
</select>
</Column>
<Column gap={ 1 }>
<Text>{ LocalizeText('navigator.maxvisitors') }</Text>
<select className="form-select form-select-sm" onChange={ event => setVisitorsCount(Number(event.target.value)) }>
{ maxVisitorsList && maxVisitorsList.map(value =>
{
return <option key={ value } value={ value }>{ value }</option>
}) }
</select>
</Column>
<Column gap={ 1 }>
<Text>{ LocalizeText('navigator.tradesettings') }</Text>
<select className="form-select form-select-sm" onChange={ event => setTradesSetting(Number(event.target.value)) }>
<option value="0">{ LocalizeText('navigator.roomsettings.trade_not_allowed') }</option>
<option value="1">{ LocalizeText('navigator.roomsettings.trade_not_with_Controller') }</option>
<option value="2">{ LocalizeText('navigator.roomsettings.trade_allowed') }</option>
</select>
</Column>
<Column gap={ 1 }>
<Text>{ LocalizeText('navigator.createroom.roomdescinfo') }</Text>
<input type="text" className="form-control form-control-sm" onChange={ event => setDescription(event.target.value) } />
</Column>
</Column> </Column>
<Column size={ 6 } gap={ 1 }> <Column size={ 6 } gap={ 1 } overflow="auto">
<Text>{ LocalizeText('navigator.category') }</Text> {
<select className="form-select form-select-sm" onChange={ event => setCategory(Number(event.target.value)) }> RoomModels.map(model =>
{ categories && categories.map(category =>
{ {
return <option key={ category.id } value={ category.id }>{ LocalizeText(category.name) }</option> return (<LayoutGridItem fullHeight key={ model.name } onClick={ () => selectModel(model) } itemActive={ (selectedModelName === model.name) } overflow="unset" gap={ 0 } className="p-1" disabled={ (GetSessionDataManager().clubLevel < model.clubLevel) }>
}) } <Flex fullHeight center overflow="hidden">
</select> <img alt="" src={ getRoomModelImage(model.name) } />
</Flex>
<Text bold>{ model.tileSize } { LocalizeText('navigator.createroom.tilesize') }</Text>
{ model.clubLevel > HabboClubLevelEnum.NO_CLUB && <CurrencyIcon position="absolute" className="top-1 end-1" type="hc" /> }
</LayoutGridItem>);
})
}
</Column> </Column>
<Column size={ 6 } gap={ 1 }> <Column size={ 12 }>
<Text>{ LocalizeText('navigator.maxvisitors') }</Text> <Button variant="success" onClick={ createRoom } disabled={ (!name || (name.length < 3)) }>{ LocalizeText('navigator.createroom.create') }</Button>
<select className="form-select form-select-sm" onChange={ event => setVisitorsCount(Number(event.target.value)) }>
{ maxVisitorsList && maxVisitorsList.map(value =>
{
return <option key={ value } value={ value }>{ value }</option>
}) }
</select>
</Column>
<Column size={ 6 } gap={ 1 }>
<Text>{ LocalizeText('navigator.tradesettings') }</Text>
<select className="form-select form-select-sm" onChange={ event => setTradesSetting(Number(event.target.value)) }>
<option value="0">{ LocalizeText('navigator.roomsettings.trade_not_allowed') }</option>
<option value="1">{ LocalizeText('navigator.roomsettings.trade_not_with_Controller') }</option>
<option value="2">{ LocalizeText('navigator.roomsettings.trade_allowed') }</option>
</select>
</Column> </Column>
</Grid> </Grid>
<Column gap={ 1 }>
<Text>{ LocalizeText('navigator.createroom.roomdescinfo') }</Text>
<input type="text" className="form-control form-control-sm" onChange={ event => setDescription(event.target.value) } />
</Column>
<Flex overflow="auto" gap={ 1 }>
{
RoomModels.map(model =>
{
return (<LayoutGridItem fullHeight key={ model.name } onClick={ () => selectModel(model) } itemActive={ (selectedModelName === model.name) } overflow="unset" gap={ 0 } className="p-1" disabled={ (GetSessionDataManager().clubLevel < model.clubLevel) }>
<Flex fullHeight center overflow="hidden">
<img alt="" src={ getRoomModelImage(model.name) } />
</Flex>
<Text bold>{ model.tileSize } { LocalizeText('navigator.createroom.tilesize') }</Text>
{ model.clubLevel > HabboClubLevelEnum.NO_CLUB && <CurrencyIcon position="absolute" className="top-1 end-1" type="hc" /> }
</LayoutGridItem>);
})
}
</Flex>
<Button variant="success" onClick={ createRoom } disabled={ (!name || (name.length < 3)) }>{ LocalizeText('navigator.createroom.create') }</Button>
</Column> </Column>
); );
} }