fully working; all comments removed; put slider setting into content object

pull/905/head
Brian Jian Zhao 6 years ago
parent ccb470207a
commit 0daaa04596

@ -88,13 +88,14 @@ export class SessionSettingListItem extends React.Component<Props, State> {
/> />
)} )}
{type === SessionSettingType.Slider && title === 'Message TTL' ? ( {type === SessionSettingType.Slider &&
content.sliderCategory === 'messageTTLSlider' ? (
<div className="slider-wrapper"> <div className="slider-wrapper">
<Slider <Slider
dots={true} dots={content.dotsEnable}
step={6} step={content.step}
min={12} min={content.min}
max={96} max={content.max}
defaultValue={currentSliderValue} defaultValue={currentSliderValue}
onAfterChange={sliderValue => { onAfterChange={sliderValue => {
this.handleSlider(sliderValue); this.handleSlider(sliderValue);
@ -105,13 +106,14 @@ export class SessionSettingListItem extends React.Component<Props, State> {
<p>{`${currentSliderValue} Hours`}</p> <p>{`${currentSliderValue} Hours`}</p>
</div> </div>
</div> </div>
) : type === SessionSettingType.Slider && title === 'Zoom Factor' ? ( ) : type === SessionSettingType.Slider &&
content.sliderCategory === 'zoomFactorSlider' ? (
<div> <div>
<Slider <Slider
dots={true} dots={content.dotsEnable}
step={20} step={content.step}
min={60} min={content.min}
max={200} max={content.max}
defaultValue={currentSliderValue} defaultValue={currentSliderValue}
onChange={sliderValue => { onChange={sliderValue => {
this.handleSlider(sliderValue); this.handleSlider(sliderValue);
@ -119,7 +121,7 @@ export class SessionSettingListItem extends React.Component<Props, State> {
/> />
<div className="slider-info"> <div className="slider-info">
<p>{`% ${currentSliderValue} Zoom Level`}</p> <p>{`Zoom Level: %${currentSliderValue}`}</p>
</div> </div>
</div> </div>
) : null} ) : null}

@ -445,6 +445,11 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
comparisonValue: undefined, comparisonValue: undefined,
onClick: undefined, onClick: undefined,
content: { content: {
dotsEnabled: true,
step: 6,
min: 12,
max: 96,
sliderCategory: 'messageTTLSlider',
defaultValue: 24, defaultValue: 24,
}, },
confirmationDialogParams: undefined, confirmationDialogParams: undefined,
@ -460,7 +465,12 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
comparisonValue: undefined, comparisonValue: undefined,
onClick: undefined, onClick: undefined,
content: { content: {
defaultValue: 24, dotsEnabled: true,
step: 20,
min: 60,
max: 200,
sliderCategory: 'zoomFactorSlider',
defaultValue: 100,
}, },
confirmationDialogParams: undefined, confirmationDialogParams: undefined,
}, },

Loading…
Cancel
Save