fiec for review '

This commit is contained in:
u-e 2019-07-18 00:20:44 +03:00
parent bd6c42e322
commit 41d2d44026
6 changed files with 22 additions and 24 deletions

View File

@ -42,4 +42,10 @@ export default EStyleSheet.create({
position: 'absolute',
borderColor: '$primaryBlue',
},
selected: {
backgroundColor: '$primaryBlue',
},
track: {
backgroundColor: '$primaryLightGray',
},
});

View File

@ -1,6 +1,7 @@
import React, { Component } from 'react';
import { View, Dimensions, Text } from 'react-native';
import MultiSlider from '@ptomasroos/react-native-multi-slider';
import get from 'lodash/get';
import styles from './scaleSliderStyles';
@ -8,8 +9,8 @@ export default class ScaleSliderView extends Component {
constructor(props) {
super(props);
this.state = {
activeValue: props.activeValue || props.values[0],
activeIndex: props.values.indexOf(props.activeValue) || 0,
activeValue: get(props, 'activeValue') || props.values[0],
activeIndex: get(props, 'values', '').indexOf(get(props, 'activeValue')) || 0,
};
}
@ -52,7 +53,7 @@ export default class ScaleSliderView extends Component {
};
render() {
const { LRpadding, values, day } = this.props;
const { LRpadding, values } = this.props;
const { activeIndex } = this.state;
return (
@ -62,8 +63,8 @@ export default class ScaleSliderView extends Component {
</View>
<View style={styles.container}>
<MultiSlider
trackStyle={{ backgroundColor: '#bdc3c7' }}
selectedStyle={{ backgroundColor: '#357ce6' }}
trackStyle={styles.track}
selectedStyle={styles.selected}
sliderLength={Dimensions.get('window').width - LRpadding * 2}
onValuesChange={this._valueChange}
values={[activeIndex + 1]}

View File

@ -2,9 +2,9 @@ import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
optionsWrapper: {
backgroundColor: 'white',
backgroundColor: '$white',
borderTopWidth: 0,
borderColor: '#000',
borderColor: '$black',
left: 0,
position: 'absolute',
right: 0,

View File

@ -1,4 +1,4 @@
import React, { Fragment } from 'react';
import React from 'react';
import { TextInput } from 'react-native';
import { connect } from 'react-redux';
@ -6,14 +6,12 @@ import { connect } from 'react-redux';
import styles from './textInputStyles';
const TextInputView = ({ isDarkTheme, innerRef, ...props }) => (
<Fragment>
<TextInput
style={styles.input}
ref={innerRef}
keyboardAppearance={isDarkTheme ? 'dark' : 'light'}
{...props}
/>
</Fragment>
<TextInput
style={styles.input}
ref={innerRef}
keyboardAppearance={isDarkTheme ? 'dark' : 'light'}
{...props}
/>
);
const mapStateToProps = state => ({

View File

@ -1,4 +1,3 @@
/* eslint-disable no-unused-vars */
import React, { Component } from 'react';
import { Alert } from 'react-native';
import { connect } from 'react-redux';
@ -116,7 +115,7 @@ class PointsContainer extends Component {
this.setState({ userPoints, balance });
})
.catch(err => {
Alert.alert(err);
Alert.alert(err.message);
});
await getUserPoints(username)

View File

@ -1,12 +1,6 @@
import { Alert } from 'react-native';
// import { Client, PrivateKey } from 'dsteem';
import ePointApi from '../../config/ePoint';
// Utils
// import { decryptKey } from '../../utils/crypto';
// const client = new Client(getItem('server', 'https://api.steemit.com'));
export const userActivity = (us, ty, bl = '', tx = '') =>
new Promise(resolve => {
const params = { us, ty };