...
 
Commits (12)
......@@ -55,11 +55,9 @@ exports[`ForgotPassword component should renders correctly 1`] = `
</Text>
<View
style={
Array [
Object {
"marginBottom": 10,
},
]
Object {
"marginBottom": 10,
}
}
>
<View
......
......@@ -85,11 +85,9 @@ exports[`ForgotScreen component should renders correctly 1`] = `
</Text>
<View
style={
Array [
Object {
"marginBottom": 10,
},
]
Object {
"marginBottom": 10,
}
}
>
<View
......
......@@ -46,11 +46,9 @@ exports[`LoginForm component should renders correctly 1`] = `
</Text>
<View
style={
Array [
Object {
"marginBottom": 10,
},
]
Object {
"marginBottom": 10,
}
}
>
<View
......@@ -123,11 +121,9 @@ exports[`LoginForm component should renders correctly 1`] = `
<View>
<View
style={
Array [
Object {
"marginBottom": 10,
},
]
Object {
"marginBottom": 10,
}
}
>
<View
......
......@@ -42,106 +42,85 @@ exports[`RegisterForm component should renders correctly 1`] = `
>
<View>
<View
accessible={true}
focusable={false}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"marginBottom": 15,
"opacity": 1,
}
}
>
<View
accessible={true}
focusable={false}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": undefined,
"fontSize": 34,
},
Object {
"color": "#939397",
},
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
</View>
<View
style={
Array [
Object {
"marginBottom": 15,
},
Object {
"alignContent": "center",
"alignItems": "center",
"alignSelf": "center",
"justifyContent": "center",
},
]
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"fontFamily": "Roboto",
"fontSize": 28,
"fontWeight": "bold",
"lineHeight": 44,
"color": undefined,
"fontSize": 34,
},
Object {
"color": "#4F4F50",
"color": "#939397",
},
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
Join the Revolution
</Text>
</View>
<View>
<Text
style={
Object {
"color": "#F00",
"paddingLeft": 4,
"paddingTop": 4,
"textAlign": "center",
}
}
/>
</View>
<View
<Text
style={
Array [
Object {
"marginBottom": 10,
"marginBottom": 15,
},
Object {
"textAlign": "center",
},
Object {
"fontFamily": "Roboto",
"fontSize": 28,
"fontWeight": "bold",
"lineHeight": 44,
},
Object {
"color": "#4F4F50",
},
]
}
>
Join the Revolution
</Text>
<Text
style={
Object {
"color": "#F00",
"paddingLeft": 4,
"paddingTop": 4,
"textAlign": "center",
}
}
/>
<View
style={
Object {
"marginBottom": 10,
}
}
>
<View
style={
......@@ -212,11 +191,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
</View>
<View
style={
Array [
Object {
"marginBottom": 10,
},
]
Object {
"marginBottom": 10,
}
}
>
<View
......@@ -288,11 +265,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
</View>
<View
style={
Array [
Object {
"marginBottom": 10,
},
]
Object {
"marginBottom": 10,
}
}
>
<View
......@@ -376,17 +351,17 @@ exports[`RegisterForm component should renders correctly 1`] = `
onStartShouldSetResponder={[Function]}
style={
Object {
"alignSelf": "flex-start",
"backgroundColor": "transparent",
"borderColor": "#ededed",
"borderRadius": 3,
"borderWidth": 0,
"margin": 5,
"marginLeft": 10,
"marginLeft": 0,
"marginRight": 10,
"marginTop": 15,
"opacity": 1,
"padding": 10,
"paddingLeft": 0,
}
}
testID="checkbox"
......@@ -396,7 +371,6 @@ exports[`RegisterForm component should renders correctly 1`] = `
Object {
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "flex-end",
}
}
>
......
......@@ -93,6 +93,7 @@ exports[`channel subscribers component should render correctly 1`] = `
</View>
</View>
<RCTScrollView
ListFooterComponent={null}
data={
Array [
Object {
......
......@@ -281,7 +281,7 @@ PODS:
- React
- RNScreens (2.0.0-alpha.11):
- React
- RNSentry (1.0.9):
- RNSentry (1.2.2):
- React
- Sentry (~> 4.4.0)
- RNShare (2.0.0):
......@@ -528,7 +528,7 @@ SPEC CHECKSUMS:
RNLocalize: 07eb7a91d10021cdf59d80061ebf3adb8a5b5688
RNReanimated: b2ab0b693dddd2339bd2f300e770f6302d2e960c
RNScreens: ad3661f864ef18d952e9a4799b6791683e33c1fc
RNSentry: 2803ba8c8129dcf26b79e9b4d8c80168be6e4390
RNSentry: 9cfa3717b1e6bf9ad4b124683e78e3b98b01d3af
RNShare: 8b171d4b43c1d886917fdd303bf7a4b87167b05c
RNSVG: f6177f8d7c095fada7cfee2e4bb7388ba426064c
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
......@@ -537,6 +537,6 @@ SPEC CHECKSUMS:
Sentry: 5d312a04e369154aeac616214f4dfc3cbcc8b296
Yoga: ba3d99dbee6c15ea6bbe3783d1f0cb1ffb79af0f
PODFILE CHECKSUM: 1f47b505eab73a09e6446d8196944df88cfdecc2
PODFILE CHECKSUM: 0d007641cd0de7e8e084380d99fff938fae2d0c4
COCOAPODS: 1.8.4
......@@ -76,21 +76,15 @@ export default class RegisterForm extends Component {
getFormBody = () => {
return (
<ScrollView style={[CS.flexContainer, CS.marginTop2x]}>
<View style={CS.marginBottom3x}>
<TouchableOpacity onPress={this.props.onBack}>
<Icon size={34} name="keyboard-arrow-left" style={CS.colorSecondaryText} />
</TouchableOpacity>
</View>
<View style={[CS.marginBottom3x, CS.centered]}>
<Text style={[CS.titleText, CS.colorPrimaryText]}>
{i18n.t('auth.join')}
</Text>
</View>
<View>
<Text style={{color: '#F00', textAlign: 'center', paddingTop:4, paddingLeft:4}}>
{this.state.error.termsAcceptedError}
</Text>
</View>
<TouchableOpacity onPress={this.props.onBack} style={CS.marginBottom3x}>
<Icon size={34} name="keyboard-arrow-left" style={CS.colorSecondaryText} />
</TouchableOpacity>
<Text style={[CS.marginBottom3x, CS.textCenter, CS.titleText, CS.colorPrimaryText]}>
{i18n.t('auth.join')}
</Text>
<Text style={{color: '#F00', textAlign: 'center', paddingTop:4, paddingLeft:4}}>
{this.state.error.termsAcceptedError}
</Text>
<Input
placeholder={i18n.t('auth.username')}
onChangeText={this.setUsername}
......@@ -123,13 +117,11 @@ export default class RegisterForm extends Component {
testID="registerPasswordConfirmInput"
/> : null }
<CheckBox
right
iconLeft
containerStyle={ComponentsStyle.registerCheckboxNew}
title={<Text style={ComponentsStyle.termsNew}>{i18n.t('auth.accept')} <Text style={ComponentsStyle.linkNew} onPress={ ()=> Linking.openURL('https://www.minds.com/p/terms') }>{i18n.t('auth.termsAndConditions')}</Text></Text>}
checked={this.state.termsAccepted}
textStyle={ComponentsStyle.registerCheckboxTextNew}
onPress={() => { this.setState({ termsAccepted: !this.state.termsAccepted }) }}
// textStyle={ComponentsStyle.registerCheckboxTextNew}
onPress={this.check}
disabled={this.state.inProgress}
testID="checkbox"
/>
......@@ -137,6 +129,10 @@ export default class RegisterForm extends Component {
);
};
check = () => {
this.setState({ termsAccepted: !this.state.termsAccepted })
};
getFormFooter = () => {
return (
<View style={CS.flexContainer}>
......
......@@ -134,22 +134,22 @@ class ChannelService {
});
}
getSubscribers(guid, filter, offset) {
const tag = `channel:subscribers:${guid}`;
// abort previous call
abort(tag);
return api.get('api/v1/subscribe/' + filter + '/' + guid, { offset: offset, limit: 12 }, tag)
.then((data) => {
return {
entities: data.users,
offset: data['load-next'],
}
})
.catch(err => {
logService.exception('[ChannelService]', err);
throw new Error (i18n.t('errorMessage'));
})
/**
* Get subscribers
* @param {string} guid
* @param {string} filter
* @param {string} offset
*/
async getSubscribers(guid, filter, offset) {
const data = await api.get('api/v1/subscribe/' + filter + '/' + guid, {
offset: offset,
limit: 12,
});
return {
entities: data.users,
offset: data['load-next'],
};
}
async getScheduledCount(guid) {
......
......@@ -25,7 +25,9 @@ export default class CompleteProfile extends Component {
* Render
*/
render() {
let onboarding = featuresService.has('onboarding-december-2019') ? 'OnboardingScreenNew' : 'OnboardingScreen';
let onboarding = featuresService.has('onboarding-december-2019')
? 'OnboardingScreenNew'
: 'OnboardingScreen';
return (
<TouchableOpacity style={[CS.padding2x]} onPress={() => navigationService.push(onboarding)}>
<View>
......
......@@ -27,14 +27,15 @@ import DiscoveryUser from '../../discovery/DiscoveryUser';
import CenteredLoading from '../../common/components/CenteredLoading';
import { CommonStyle } from '../../styles/Common';
import colors from '../../styles/Colors';
import ErrorLoading from '../../common/components/ErrorLoading';
/**
* Discovery screen
*/
export default
@inject('channelSubscribersStore')
@observer
export default class ChannelSubscribers extends Component {
class ChannelSubscribers extends Component {
/**
* On component will mount
......@@ -66,35 +67,40 @@ export default class ChannelSubscribers extends Component {
render() {
let body;
const channels = this.props.channelSubscribersStore;
const store = this.props.channelSubscribersStore;
const footerCmp = store.errorLoading ? (
<ErrorLoading message={i18n.t('cantLoad')} tryAgain={store.loadList} />
) : null;
if (!channels.list.loaded && !channels.list.refreshing) {
body = <CenteredLoading />
if (!store.list.loaded && !store.list.refreshing && !store.errorLoading) {
body = <CenteredLoading />;
} else {
body = (
<FlatList
data={channels.list.entities.slice()}
data={store.list.entities.slice()}
renderItem={this.renderRow}
keyExtractor={item => item.guid}
onRefresh={this.refresh}
refreshing={channels.list.refreshing}
refreshing={store.list.refreshing}
onEndReached={this.loadFeed}
// onEndReachedThreshold={0}
initialNumToRender={12}
style={styles.listView}
removeClippedSubviews={false}
ListFooterComponent={footerCmp}
/>
)
);
}
return (
<View style={CommonStyle.flexContainer}>
<View style={styles.topbar}>
<View style={[CommonStyle.flexContainer, CommonStyle.rowJustifyCenter]}>
<TouchableHighlight underlayColor='transparent' onPress={() => channels.setFilter('subscribers')} style={channels.filter == 'subscribers'? [styles.selectedButton, CommonStyle.flexContainerCenter]: [styles.buttons, CommonStyle.flexContainerCenter]}>
<TouchableHighlight underlayColor='transparent' onPress={() => store.setFilter('subscribers')} style={store.filter == 'subscribers'? [styles.selectedButton, CommonStyle.flexContainerCenter]: [styles.buttons, CommonStyle.flexContainerCenter]}>
<Text>{i18n.t('subscribers')}</Text>
</TouchableHighlight>
<TouchableHighlight underlayColor='transparent' onPress={() => channels.setFilter('subscriptions')} style={channels.filter == 'subscriptions'? [styles.selectedButton, CommonStyle.flexContainerCenter]: [styles.buttons, CommonStyle.flexContainerCenter ]}>
<TouchableHighlight underlayColor='transparent' onPress={() => store.setFilter('subscriptions')} style={store.filter == 'subscriptions'? [styles.selectedButton, CommonStyle.flexContainerCenter]: [styles.buttons, CommonStyle.flexContainerCenter ]}>
<Text>{i18n.t('subscriptions')}</Text>
</TouchableHighlight>
</View>
......@@ -104,7 +110,6 @@ export default class ChannelSubscribers extends Component {
);
}
/**
* Load subs data
*/
......
import {
observable,
action
} from 'mobx'
import { observable, action } from 'mobx';
import OffsetListStore from '../../common/stores/OffsetListStore';
import channelService from '../ChannelService';
import UserModel from '../UserModel';
import logService from '../../common/services/log.service';
/**
* Subscribers Store
*/
class ChannelSubscribersStore {
list = new OffsetListStore();
@observable errorLoading = false;
@observable loading = false;
@observable filter = 'subscribers';
guid = '';
loading = false;
setGuid(guid) {
let reload = (this.guid != guid);
let reload = this.guid != guid;
this.guid = guid;
this.loadList(reload);
}
/**
* Load boost list
* Set action
*/
loadList(reload = false) {
@action
setLoading(value: boolean) {
this.loading = value;
}
/**
* Set the error loading flag
* @param {boolean} value
*/
@action
setErrorLoading(value: boolean) {
this.errorLoading = value;
}
/**
* Load boost list
*/
loadList = async (reload = false) => {
if (this.list.cantLoadMore()) {
return Promise.resolve();
}
if(reload)
if (reload) {
this.list.clearList();
}
this.loading = true;
return channelService.getSubscribers(this.guid, this.filter, this.list.offset)
.then( feed => {
feed.entities = UserModel.createMany(feed.entities);
this.list.setList(feed);
})
.finally(() => {
this.loading = false;
});
}
try {
this.setLoading(true);
this.setErrorLoading(false);
const feed = await channelService.getSubscribers(
this.guid,
this.filter,
this.list.offset,
);
feed.entities = UserModel.createMany(feed.entities);
this.list.setList(feed);
} catch (err) {
this.setErrorLoading(true);
logService.exception(err);
} finally {
this.setLoading(false);
}
};
@action
reset() {
......@@ -62,10 +84,9 @@ class ChannelSubscribersStore {
*/
refresh() {
this.list.refresh();
this.loadList()
.finally(() => {
this.list.refreshDone();
});
this.loadList().finally(() => {
this.list.refreshDone();
});
}
@action
......@@ -77,4 +98,4 @@ class ChannelSubscribersStore {
}
}
export default ChannelSubscribersStore;
\ No newline at end of file
export default ChannelSubscribersStore;
import React, {Component} from 'react';
import {StyleSheet, Text} from 'react-native';
import IconMC from 'react-native-vector-icons/MaterialCommunityIcons';
import {Tooltip} from 'react-native-elements';
import { ScrollView } from 'react-native-gesture-handler';
// workaround for android
import Tooltip from "rne-modal-tooltip";
export default class InfoPopup extends Component {
render() {
......
......@@ -122,16 +122,18 @@ export default class Input extends Component {
* Render
*/
render() {
const optional = (<Text style={[styles.optional]}>{"Optional"}</Text>);
const optional = this.props.optional ? (
<Text style={[styles.optional]}>{'Optional'}</Text>
) : null;
return (
<View style={[CS.marginBottom2x]}>
<View style={CS.marginBottom2x}>
<View style={[styles.row, CS.marginBottom]}>
<View style={styles.row}>
<Text style={[styles.label]}>{this.props.placeholder}</Text>
{this.props.info && <InfoPopup info={this.props.info} />}
</View>
{this.props.optional && optional}
{optional}
</View>
{this.renderInput()}
</View>
......
......@@ -34,10 +34,6 @@ class FeaturesService {
this.features = features;
// set this to true as per request for build test
// TODO: remove this...
this.features['onboarding-december-2019'] = true;
this.loaded = true;
}
......
......@@ -158,9 +158,9 @@ class NewsfeedStore {
prepend(entity) {
const model = ActivityModel.checkOrCreate(entity);
model.listRef = this.listRef.listRef;
this.feedStore.prepend(model);
model.listRef = this.listRef.listRef;
}
@action
......
......@@ -101,9 +101,10 @@ export const ComponentsStyle = StyleSheet.create({
},
registerCheckboxNew: {
backgroundColor: 'transparent',
marginLeft: 0,
paddingLeft: 0,
borderWidth: 0,
alignSelf: 'flex-start',
marginTop: 15
marginTop: 15,
},
//button
......
This source diff could not be displayed because it is too large. You can view the blob instead.