Skip to content

Commit

Permalink
Merge pull request #14 from TakaApp/betatest-review
Browse files Browse the repository at this point in the history
Betatest review / comments 1
  • Loading branch information
AkselsLedins authored Jan 28, 2019
2 parents 4853489 + 780bf56 commit 7b0f567
Show file tree
Hide file tree
Showing 11 changed files with 403 additions and 35 deletions.
6 changes: 6 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import React from 'react';
import Sentry from 'sentry-expo';

import { Provider } from 'react-redux';

import App from './src/App';
import store from './src/store';

Sentry.enableInExpoDevelopment = true;

Sentry.config('https://e62dd7e9d90245a1a149905445fdad8b@sentry.io/1381539').install();

export default class RootComponent extends React.Component {
render() {
return (
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"privacy": "public",
"sdkVersion": "32.0.0",
"platforms": ["ios", "android"],
"version": "3.0.0",
"version": "3.0.1",
"orientation": "portrait",
"icon": "./src/assets/images/icon.png",
"splash": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"redux": "^4.0.1",
"redux-actions": "^2.6.4",
"redux-saga": "^0.16.2",
"sentry-expo": "^1.11.2",
"uuid": "^3.3.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchLocation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SearchLocation extends Component {
const data = await response.json();
this.setState({ data: data || [], hasSearched: true, loading: false });
} catch (e) {
this.props.putError(`Le serveur a quelques problèmes... (ง'̀-'́)ง`);
this.props.putError(`On a quelques problèmes pour se connecter au serveur... (ง'̀-'́)ง`);
this.setState({ loading: false });
}
};
Expand Down
16 changes: 11 additions & 5 deletions src/domains/error/reducer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Sentry from 'sentry-expo';

import { handleActions } from 'redux-actions';

import { ERROR, DISMISS_ERROR } from './constants';
Expand All @@ -9,11 +11,15 @@ const initialState = {

export const error = handleActions(
{
[ERROR]: (state, action) => ({
...state,
message: action.payload,
error: true,
}),
[ERROR]: (state, action) => {
Sentry.captureMessage(action.payload);

return {
...state,
message: action.payload,
error: true,
};
},
[DISMISS_ERROR]: state => ({
...state,
...initialState,
Expand Down
10 changes: 10 additions & 0 deletions src/domains/search/sagas.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import moment from 'moment';
import { Permissions } from 'expo';
import Sentry from 'sentry-expo';

import { select, put, takeLatest } from 'redux-saga/effects';

Expand Down Expand Up @@ -43,6 +44,15 @@ function* searchOnParameterChanges() {
event('search', 'received', 'itinerary-results', results.length);
} catch (e) {
event('search', 'received', 'error');
Sentry.captureMessage(
`Failed to search with: ${JSON.stringify({
arriveBy: sp.arriveBy ? 'true' : 'false',
time: moment(sp.date).format('HH:mm'),
date: moment(sp.date).format('MM-DD-YYYY'),
from: `${sp.from.lat},${sp.from.lng}`,
to: `${sp.to.lat},${sp.to.lng}`,
})}`
);
yield put({ type: SET_IS_LOADING, payload: false });
yield put({ type: RECEIVED_RESULTS, payload: [] });
yield put({ type: 'ERROR', payload: `Le serveur a quelques problèmes... (ง'̀-'́)ง` });
Expand Down
5 changes: 4 additions & 1 deletion src/screens/HomeScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ class HomeScreen extends React.Component {
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
showsUserLocation>
showsUserLocation
showsCompass={false}
showsScale={false}
rotateEnabled={false}>
{searchParameters.to && (
<Marker
identifier="To"
Expand Down
4 changes: 2 additions & 2 deletions src/screens/ItineraryScreen/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { black, white } from '@/utils/colors';

export default class ItineraryScreen extends Component {
render() {
const { itinerary: i, isSelected } = this.props;
const { itinerary: i } = this.props;

return (
<LinearGradient
colors={isSelected ? ['#83EAF1', '#63A4FF'] : ['#FFF', '#FFF']}
colors={['#FF928B', '#FFAC81']}
start={{ x: 0, y: 0.6 }}
end={{ x: 1, y: 0.25 }}
style={{
Expand Down
13 changes: 7 additions & 6 deletions src/screens/ItineraryScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ItineraryScreen extends React.Component {
<Ionicons name="ios-arrow-back" size={48} color={black} />
</TouchableOpacity>
</View>
<View>
<ScrollView>
<View
style={{
backgroundColor: '#FFF',
Expand All @@ -99,7 +99,10 @@ class ItineraryScreen extends React.Component {
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
showsUserLocation>
showsUserLocation
showsCompass={false}
showsScale={false}
rotateEnabled={false}>
{trips.map((trip, index) => {
return (
<React.Fragment key={index}>
Expand Down Expand Up @@ -135,10 +138,8 @@ class ItineraryScreen extends React.Component {
/>
</MapView>
</View>
<Header itinerary={itinerary} />
</View>
<Header itinerary={itinerary} isSelected />
</View>
<ScrollView>
<View style={styles.legs}>{itinerary.legs.map(LegFactory.build)}</View>
</ScrollView>
</View>
Expand All @@ -159,7 +160,7 @@ const styles = StyleSheet.create({
},
map: {
flexGrow: 1,
height: 256,
height: 384,
},
header: {
backgroundColor: black,
Expand Down
16 changes: 5 additions & 11 deletions src/screens/SettingsScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class SettingsScreen extends React.Component {
this.searchForNewLocation('home')();
}}>
<LinearGradient
colors={!home ? ['#09c6f9', '#045de9'] : ['#09c6f9', '#045de9']}
colors={home ? ['#09c6f9', '#045de9'] : ['#BDD4E7', '#BDD4E7']}
start={{ x: 0, y: 0.6 }}
end={{ x: 1, y: 0.25 }}
style={{
Expand All @@ -76,21 +76,17 @@ export default class SettingsScreen extends React.Component {
</View>
<View>
{home && <Text style={{ color: '#FFF' }}>{home.name}</Text>}
{!home && (
<Text style={{ color: '#FFF' }}>
Appuyez pour définir le lieu de votre habitation
</Text>
)}
{!home && <Text style={{ color: '#FFF' }}>Appuyez pour définir un lieu</Text>}
</View>
</LinearGradient>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
event('shortcut', 'change', 'work');
this.searchForNewLocation('work');
this.searchForNewLocation('work')();
}}>
<LinearGradient
colors={!work ? ['#09c6f9', '#045de9'] : ['#09c6f9', '#045de9']}
colors={work ? ['#09c6f9', '#045de9'] : ['#BDD4E7', '#BDD4E7']}
start={{ x: 0, y: 0.6 }}
end={{ x: 1, y: 0.25 }}
style={{
Expand All @@ -107,9 +103,7 @@ export default class SettingsScreen extends React.Component {
</View>
<View>
{work && <Text style={{ color: '#FFF' }}>{work.name}</Text>}
{!work && (
<Text style={{ color: '#FFF' }}>Appuyez pour définir le lieu de travail</Text>
)}
{!work && <Text style={{ color: '#FFF' }}>Appuyez pour définir un lieu</Text>}
</View>
</LinearGradient>
</TouchableOpacity>
Expand Down
Loading

0 comments on commit 7b0f567

Please sign in to comment.