mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 18:32:36 +01:00
Rest
This commit is contained in:
parent
3e914a601a
commit
33e2baeb20
@ -17,6 +17,7 @@ import { WiredActionLeaveTeamView } from '../views/actions/leave-team/WiredActio
|
|||||||
import { WiredActionMoveAndRotateFurniView } from '../views/actions/move-and-rotate-furni/WiredActionMoveAndRotateFurniView';
|
import { WiredActionMoveAndRotateFurniView } from '../views/actions/move-and-rotate-furni/WiredActionMoveAndRotateFurniView';
|
||||||
import { WiredActionMoveFurniToView } from '../views/actions/move-furni-to/WiredActionMoveFurniToView';
|
import { WiredActionMoveFurniToView } from '../views/actions/move-furni-to/WiredActionMoveFurniToView';
|
||||||
import { WiredActionMoveFurniView } from '../views/actions/move-furni/WiredActionMoveFurniView';
|
import { WiredActionMoveFurniView } from '../views/actions/move-furni/WiredActionMoveFurniView';
|
||||||
|
import { WiredActionMuteUserView } from '../views/actions/mute-user/WiredActionMuteUserView';
|
||||||
import { WiredActionResetView } from '../views/actions/reset/WiredActionResetView';
|
import { WiredActionResetView } from '../views/actions/reset/WiredActionResetView';
|
||||||
import { WiredActionSetFurniStateToView } from '../views/actions/set-furni-state-to/WiredActionSetFurniStateToView';
|
import { WiredActionSetFurniStateToView } from '../views/actions/set-furni-state-to/WiredActionSetFurniStateToView';
|
||||||
import { WiredActionTeleportView } from '../views/actions/teleport/WiredActionTeleportView';
|
import { WiredActionTeleportView } from '../views/actions/teleport/WiredActionTeleportView';
|
||||||
@ -65,6 +66,8 @@ export function GetWiredActionLayout(code: number): JSX.Element
|
|||||||
return <WiredActionMoveAndRotateFurniView />;
|
return <WiredActionMoveAndRotateFurniView />;
|
||||||
case WiredActionLayout.MOVE_FURNI_TO:
|
case WiredActionLayout.MOVE_FURNI_TO:
|
||||||
return <WiredActionMoveFurniToView />;
|
return <WiredActionMoveFurniToView />;
|
||||||
|
case WiredActionLayout.MUTE_USER:
|
||||||
|
return <WiredActionMuteUserView />;
|
||||||
case WiredActionLayout.RESET:
|
case WiredActionLayout.RESET:
|
||||||
return <WiredActionResetView />;
|
return <WiredActionResetView />;
|
||||||
case WiredActionLayout.SET_FURNI_STATE:
|
case WiredActionLayout.SET_FURNI_STATE:
|
||||||
|
@ -22,7 +22,7 @@ export const WiredActionKickFromRoomView: FC<{}> = props =>
|
|||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label>{ LocalizeText('wiredfurni.params.message') }</label>
|
<label className="fw-bold">{ LocalizeText('wiredfurni.params.message') }</label>
|
||||||
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
||||||
</div>
|
</div>
|
||||||
</WiredActionBaseView>
|
</WiredActionBaseView>
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
import Slider from 'rc-slider/lib/Slider';
|
||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionMuteUserView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ time, setTime ] = useState(-1);
|
||||||
|
const [ message, setMessage ] = useState('');
|
||||||
|
const { trigger = null, setIntParams = null, setStringParam = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setTime((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
||||||
|
setMessage(trigger.stringData);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setIntParams([time]);
|
||||||
|
setStringParam(message);
|
||||||
|
}, [ time, message, setIntParams, setStringParam ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
|
|
||||||
|
<div className="fw-bold">{ LocalizeText('wiredfurni.params.length.minutes', ['minutes'], [time.toString()]) }</div>
|
||||||
|
<Slider
|
||||||
|
defaultValue={ time }
|
||||||
|
dots={ true }
|
||||||
|
min={ 1 }
|
||||||
|
max={ 10 }
|
||||||
|
step={ 1 }
|
||||||
|
onChange={ event => setTime(event) }
|
||||||
|
/>
|
||||||
|
<hr className="my-1 mb-2 bg-dark" />
|
||||||
|
<div className="form-group">
|
||||||
|
<label className="fw-bold">{ LocalizeText('wiredfurni.params.message') }</label>
|
||||||
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
||||||
|
</div>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user