Commit 88a40ff8 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(fix) minor fixes and suggested groups and channel now use selected hashtags

1 merge request!489WIP: Fix various issues for new onboarding and Email Confirmation
......@@ -25,6 +25,7 @@ import logService from '../common/services/log.service';
import featuresService from '../common/services/features.service';
import CenteredLoading from '../common/components/CenteredLoading';
import { inject } from 'mobx-react/native';
import sessionService from '../common/services/session.service';
const LOGO_HEIGHT = 100;
const LOGO_HEIGHT_SMALL = 50;
......@@ -50,6 +51,11 @@ export default class LoginScreen extends Component {
super(props);
this.logoHeight = new Animated.Value(LOGO_HEIGHT);
// Setting this here because if user register, then onboarding then logout and login again, will go to onboarding again
sessionService.setInitialScreen('Tabs');
this.setState({ loading:true });
}
async componentDidMount() {
......
......@@ -35,7 +35,7 @@ const styles = StyleSheet.create({
borderRadius: 2,
paddingHorizontal: 30,
paddingVertical: 5,
marginTop: 10,
marginTop: 5,
},
skipText: {
color: '#AEB0B8',
......
......@@ -35,7 +35,7 @@ import SuggestedGroupsStepNew from './steps/SuggestedGroupsStepNew';
import AllDoneStep from './steps/AllDoneStep';
@observer
@inject('onboarding', 'hashtag', 'groupsBar')
@inject('onboarding', 'hashtag', 'groupsBar', 'discovery')
export default class OnboardingScreenNew extends Component {
/**
......@@ -50,15 +50,31 @@ export default class OnboardingScreenNew extends Component {
await this.props.onboarding.setShown(true);
//await this.props.onboarding.getProgress();
this.props.hashtag.setAll(false);
this.props.groupsBar.reset();
await this.props.groupsBar.loadGroups();
await this.props.groupsBar.loadMarkers();
await this.loadJoinedGroups();
await this.clearDiscovery();
navigationService.navigate('Tabs');
} catch (err) {
Alert.alert(i18nService.t('error'), i18n.t('errorMessage') + '\n' + i18n.t('tryAgain'))
}
}
/**
* Load the groups user joined on suggested groups step
*/
loadJoinedGroups = async () => {
this.props.groupsBar.reset();
await this.props.groupsBar.loadGroups();
await this.props.groupsBar.loadMarkers();
}
/**
* Clear discovery used for suggested groups and channels
*/
clearDiscovery = async () => {
this.props.discovery.clearList();
this.props.discovery.reset();
}
handleWizarRef = (ref) => {
this.wizard = ref;
}
......
......@@ -16,7 +16,7 @@ import i18n from '../../common/services/i18n.service';
import OnboardingButtons from '../OnboardingButtons';
import OnboardingBackButton from '../OnboardingBackButton';
@inject('discovery')
@inject('discovery', 'hashtag')
@observer
export default class SuggestedGroupsStepNew extends Component {
......@@ -27,6 +27,7 @@ export default class SuggestedGroupsStepNew extends Component {
}
componentDidMount() {
this.props.hashtag.setAll(false);
this.props.discovery.filters.setType('groups');
this.props.discovery.filters.setPeriod('1y');
}
......
......@@ -56,7 +56,7 @@ export default class WelcomeStep extends Component {
>
<Text style={ComponentsStyle.loginButtonTextNew}>{i18nService.t('onboarding.welcomeSetup')}</Text>
</Button>
<Text style={[CS.linkNew, CS.marginTop4x, CS.centered]} onPress={ this.props.onFinish }>{i18nService.t('onboarding.welcomeLater')}</Text>
<Text style={[CS.linkNew, CS.marginTop2x, CS.centered]} onPress={ this.props.onFinish }>{i18nService.t('onboarding.welcomeLater')}</Text>
</View>
)
}
......
import React, { Component } from 'react';
import { Text, StyleSheet, View, Alert } from 'react-native';
import { Text, StyleSheet, View, Alert, Platform } from 'react-native';
import i18n from '../common/services/i18n.service';
import emailConfirmationService from '../common/services/email-confirmation.service';
import IonIcon from 'react-native-vector-icons/Ionicons';
......@@ -61,6 +61,8 @@ class EmailConfirmation extends Component {
}
}
const topPosition = Platform.OS === 'ios' ? (isIphoneX ? 40 : 30) : 0;
const styles = StyleSheet.create({
container: {
backgroundColor: '#4690df',
......@@ -70,7 +72,8 @@ const styles = StyleSheet.create({
justifyContent: 'center',
position: 'absolute',
width: '100%',
top: isIphoneX ? 40 : 30,
top: topPosition,
zIndex: 999,
},
body: {
flexDirection: 'column',
......
Please register or to comment