Update sliders

This commit is contained in:
Bill 2021-08-09 12:34:31 -04:00
parent fb740631c4
commit 54ab6a5f61
13 changed files with 65 additions and 51 deletions

View File

@ -1,6 +1,6 @@
import { WiredActionDefinition } from '@nitrots/nitro-renderer';
import Slider from 'rc-slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
import { useWiredContext } from '../../../context/WiredContext';
@ -34,10 +34,11 @@ export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props =>
</> }
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) }</label>
<Slider
value={ delay }
<ReactSlider
className={ 'nitro-slider' }
min={ 0 }
max={ 20 }
value={ delay }
onChange={ event => setDelay(event) } />
</div>
</WiredBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -105,14 +105,13 @@ export const WiredActionGiveRewardView: FC<{}> = props =>
{ !limitEnabled && <div className="bg-muted rounded small text-black p-1 text-center">
Reward limit not set. Make sure rewards are badges or non-tradeable items.
</div> }
{ limitEnabled && <Slider
defaultValue={ rewardsLimit }
dots={ true }
min={ 1 }
max={ 1000 }
step={ 1 }
onChange={ event => setRewardsLimit(event) }
/> }
{ limitEnabled &&
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 1000 }
value={ rewardsLimit }
onChange={ event => setRewardsLimit(event) } /> }
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">How ofter can a user be rewarded?</div>
<div className="d-flex">

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -37,18 +37,20 @@ export const WiredActionGiveScoreToPredefinedTeamView: FC<{}> = props =>
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</label>
<Slider
value={ points }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 100 }
value={ points }
onChange={ event => setPoints(event) } />
</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.settimesingame', [ 'times' ], [ time.toString() ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 10 }
value={ time }
onChange={ event => setTime(event) } />
</div>
<div className="form-group">

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -34,18 +34,20 @@ export const WiredActionGiveScoreView: FC<{}> = props =>
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</label>
<Slider
value={ points }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 100 }
value={ points }
onChange={ event => setPoints(event) } />
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.settimesingame', [ 'times' ], [ time.toString() ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 10 }
value={ time }
onChange={ event => setTime(event) } />
</div>
</WiredActionBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -53,10 +53,11 @@ export const WiredActionMoveFurniToView: FC<{}> = props =>
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ save }>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.emptytiles', [ 'tiles' ], [ spacing.toString() ]) }</label>
<Slider
value={ spacing }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 5 }
value={ spacing }
onChange={ event => setSpacing(event) } />
</div>
<div className="form-group">

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -27,10 +27,11 @@ export const WiredActionMuteUserView: FC<{}> = props =>
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.length.minutes', ['minutes'], [ time.toString() ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 10 }
value={ time }
onChange={ event => setTime(event) } />
</div>
<div className="form-group">

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
import { useWiredContext } from '../../../context/WiredContext';
@ -25,10 +25,11 @@ export const WiredConditionTimeElapsedLessView: FC<{}> = props =>
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.allowbefore', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 1200 }
value={ time }
onChange={ event => setTime(event) } />
</div>
</WiredConditionBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
import { useWiredContext } from '../../../context/WiredContext';
@ -25,10 +25,11 @@ export const WiredConditionTimeElapsedMoreView: FC<{}> = props =>
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.allowafter', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 1200 }
value={ time }
onChange={ event => setTime(event) } />
</div>
</WiredConditionBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -34,18 +34,20 @@ export const WiredConditionUserCountInRoomView: FC<{}> = props =>
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.usercountmin', [ 'value' ], [ min.toString() ]) }</label>
<Slider
value={ min }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 50 }
value={ min }
onChange={ event => setMin(event) } />
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.usercountmax', [ 'value' ], [ max.toString() ]) }</label>
<Slider
value={ max }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 50 }
value={ max }
onChange={ event => setMax(event) } />
</div>
</WiredConditionBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
import { useWiredContext } from '../../../context/WiredContext';
@ -25,10 +25,11 @@ export const WiredTriggeExecuteOnceView: FC<{}> = props =>
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 1200 }
value={ time }
onChange={ event => setTime(event) } />
</div>
</WiredTriggerBaseView>

View File

@ -1,6 +1,6 @@
import { FriendlyTime } from '@nitrots/nitro-renderer';
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -25,10 +25,11 @@ export const WiredTriggeExecutePeriodicallyLongView: FC<{}> = props =>
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.setlongtime', [ 'time' ], [ FriendlyTime.format(time * 5).toString() ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 120 }
value={ time }
onChange={ event => setTime(event) } />
</div>
</WiredTriggerBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
import { useWiredContext } from '../../../context/WiredContext';
@ -25,10 +25,11 @@ export const WiredTriggeExecutePeriodicallyView: FC<{}> = props =>
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</label>
<Slider
value={ time }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 60 }
value={ time }
onChange={ event => setTime(event) } />
</div>
</WiredTriggerBaseView>

View File

@ -1,5 +1,5 @@
import Slider from 'rc-slider/lib/Slider';
import { FC, useCallback, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
@ -24,10 +24,11 @@ export const WiredTriggeScoreAchievedView: FC<{}> = props =>
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.setscore', [ 'points' ], [ points.toString() ]) }</label>
<Slider
value={ points }
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 1000 }
value={ points }
onChange={ event => setPoints(event) } />
</div>
</WiredTriggerBaseView>