Skip to content

Commit

Permalink
Merge branch 'development' into refactor-add-company
Browse files Browse the repository at this point in the history
  • Loading branch information
alexup19 committed May 10, 2019
2 parents 552cb67 + d797952 commit 82d3acd
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 83 deletions.
Binary file added src/assets/images/ginny/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 7 additions & 9 deletions src/components/audio-player/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,16 @@ class AudioPlayer extends Component<State, Props> {
} else {
const filepath = this.props.filepath;
console.log("[Play]", filepath);

this.sound = new Sound(filepath, "", error => {
if (error) {
console.log("failed to load the sound", error);
Alert.alert("Notice", "audio file error. (Error code : 1)");
this.setState({ playState: "paused" });
console.log('failed to load the sound', error);
Alert.alert('Notice', 'audio file error. (Error code : 1)');
this.setState({playState:'paused'});
} else {
this.setState({
playState: "playing",
duration: this.sound.getDuration()
});
this.sound.play(this.playComplete);
if(this.sound){
this.setState({playState:'playing', duration:this.sound.getDuration()});
this.sound.play(this.playComplete);
}
}
});
}
Expand Down
14 changes: 9 additions & 5 deletions src/components/confirmation-card/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Button } from "native-base";
import Stylesheet from "./stylesheet";
import { colors } from "../../config/styles";
import { getPercentage } from "../../utils/helpers";
import { appImages } from '../../config/imagesRoutes';

const deviceWidth = Dimensions.get("window").width;
const itemWidth = getPercentage(deviceWidth, 80);
Expand All @@ -30,11 +31,14 @@ class ConfirmationCard extends Component<Props, State> {

render() {
const { title, subTitle, onCancelPress, onConfirmPress } = this.props;

return (
<View style={Stylesheet.container}>
<View>
<Text style={Stylesheet.title}>{title}</Text>
return (
<View style={ Stylesheet.container }>
<View style={ Stylesheet.topContainer }>
<Image
source={ appImages.GinnyLogo.uri }
style={Stylesheet.logo}
/>
<Text style={ Stylesheet.title }>{ title }</Text>
</View>
<View style={Stylesheet.bottomContainer}>
<Text style={Stylesheet.subTitle}>{subTitle}</Text>
Expand Down
15 changes: 13 additions & 2 deletions src/components/confirmation-card/stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,25 @@ export default StyleSheet.create({
fontSize: 14
},
title: {
alignSelf: 'center',
fontSize: 18,
fontWeight: 'bold',
color: colors.brandPrimary
color: colors.brandPrimary,
marginTop: 5
},
topContainer: {
alignItems: 'center',
justifyContent: 'center',
paddingTop: 25,
paddingBottom: 10
},
bottomContainer: {
borderTopWidth: 2,
borderColor: colors.brandLightGray,
paddingBottom: 35
},
logo: {
//alignSelf: 'center',
width: 56,
height: 48
}
});
3 changes: 1 addition & 2 deletions src/config/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ instance.interceptors.request.use(function (config) {
if(!config.url.includes('auth')){
const token = store.getState().session.token;
config.headers.Authorization = token;
config.headers["Content-Type"] = "application/json";
}
return config;
}, function (error) {
Expand All @@ -32,4 +31,4 @@ instance.interceptors.response.use(function (response) {
return Promise.reject(error);
});

module.exports = instance;
module.exports = instance;
5 changes: 4 additions & 1 deletion src/config/imagesRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export const appImages = {
},
Logo: {
uri: require('../assets/images/companyBranding/secondary-logo.10e49eac.png')
}
},
GinnyLogo: {
uri: require('../assets/images/ginny/logo.png')
},
};

4 changes: 2 additions & 2 deletions src/config/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export const colors = {
brandGold: '#f1ac2f',
brandGoldDisable: '#f1ac2f',
normalWhite: '#ffffff',
facebook: '#3b5998',
gmail: '#CD5644'
facebook: '#6D7EC5',
gmail: '#EF3636'
};
// HELPERS
// Padding-Margins
Expand Down
19 changes: 10 additions & 9 deletions src/screens/edit-profile/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ class EditProfile extends Component {
return (
this.state.userName &&
this.state.userLastName &&
this.state.userEmail &&
this.state.userPassword
this.state.userEmail
);
}

Expand All @@ -260,20 +259,21 @@ class EditProfile extends Component {

this.setState({ isLoading: true });

let data = {
const data = {
firstname: this.state.userName,
lastname: this.state.userLastName,
email: this.state.userEmail,
password: this.state.userPassword,
default_company: this.state.userDefaultFamily
};

const headers= {
'Content-Type': 'application/x-www-form-urlencoded',
}

axios
.put(
`/users/${this.props.userInfo.id}`,
this.formatFormData(data)
)
.put(`/users/${this.props.userInfo.id}`, data, headers)
.then(response => {
console.log(response.data);
let userSelectedFamilty = this.getDefaultFamilyName();
if (userSelectedFamilty) {
this.changeActiveFamily(userSelectedFamilty);
Expand All @@ -282,7 +282,8 @@ class EditProfile extends Component {
console.log(response.data);
})
.catch(function(error) {
console.log(error.response);
console.log(error.message);
this.setState({ isLoading: false });
});
}

Expand Down
21 changes: 17 additions & 4 deletions src/screens/login/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,27 @@ class Login extends Component {
});
}

popScreen(activeScreen) {
Navigation.pop(this.props.componentId, {
component: {
name: activeScreen,
options: {
topBar: {
visible: false
}
}
}
});
}

// Defines title bar's left content
titleBarLeft() {
return {
content: (
<View>
<TouchableOpacity
transparent
onPress={() => this.pushScreen('canvas.Welcome')}
onPress={() => this.popScreen('canvas.Welcome')}
>
<Icon
type={'Ionicons'}
Expand Down Expand Up @@ -490,16 +503,16 @@ class Login extends Component {
<View style={StyleSheet.btnContainer}>
<Button
block
style={[StyleSheet.submitBtnInv, { width: 155 }]}
style={[StyleSheet.googleBtn, { width: 155 }]}
onPress={() => this.signInWithGoogleAsync()}
>
<Text style={StyleSheet.buttonTextPrimary}>
<Text style={StyleSheet.googleText}>
Gmail
</Text>
</Button>
<Button
block
style={[StyleSheet.submitBtn, { width: 155 }]}
style={[StyleSheet.facebookBtn, { width: 155 }]}
onPress={() => this.signInWithFacebookAsync()}
>
<Text style={StyleSheet.buttonText}>
Expand Down
31 changes: 21 additions & 10 deletions src/screens/login/stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,32 @@ export default StyleSheet.create({
backgroundColor: 'white'
},
googleBtn: {
backgroundColor: colors.gmail,
width: '70%',
alignSelf: 'center'
marginTop: paddingHelpers.S,
marginBottom: paddingHelpers.S,
borderBottomWidth: 2,
borderTopWidth: 2,
borderLeftWidth: 2,
borderRightWidth: 2,
borderColor: colors.gmail,
height: 48,
borderRadius: 3,
backgroundColor: 'white'
},
googleText: {
color: '#fff',
textAlign: 'center',
width: '100%'
color: colors.gmail,
fontWeight: 'bold',
fontSize: 12
},
facebookBtn: {
marginTop: paddingHelpers.S,
marginBottom: paddingHelpers.XS,
backgroundColor: colors.facebook,
width: '70%',
alignSelf: 'center'
marginBottom: paddingHelpers.S,
borderBottomWidth: 0,
borderTopWidth: 0,
borderLeftWidth: 0,
borderRightWidth: 0,
height: 48,
borderRadius: 3,
backgroundColor: colors.facebook
},
facebookText: {
color: '#fff',
Expand Down
Loading

0 comments on commit 82d3acd

Please sign in to comment.