Skip to content

Commit d6e577a

Browse files
committed
adjust some layout issues
1 parent cb50af6 commit d6e577a

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules/**/*
22
.expo/*
33
npm-debug.*
44
.idea
5-
env.js
5+
env.js
6+
*.iml

src/components/Profile.js

+21-7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {NavigationActions} from 'react-navigation';
1818
import UpdateUserMutation from '../mutations/UpdateUserMutation'
1919
import TechnologiesBlock from "./TechnologiesBlock";
2020
import CheckinList from "./CheckinList";
21+
import main from "../styles/main";
2122

2223
class Profile extends React.Component {
2324

@@ -31,7 +32,8 @@ class Profile extends React.Component {
3132
edit: false,
3233
text: "testing",
3334
technologies: [],
34-
technologiesToRemove: []
35+
technologiesToRemove: [],
36+
wait: false
3537
}
3638

3739
componentDidMount() {
@@ -122,6 +124,8 @@ class Profile extends React.Component {
122124

123125
if (profilePic) {
124126

127+
this.setState({wait: true})
128+
125129
const file = {
126130
uri: profilePic,
127131
name: uuidv4() + ".jpg",
@@ -140,6 +144,7 @@ class Profile extends React.Component {
140144
const s3Res = await RNS3.put(file, options);
141145

142146
if(s3Res.status !== 201) {
147+
this.setState({wait: false})
143148
console.log('\n>>>>> Fail to upload profile pic to S3', s3Res);
144149
alert('Fail to upload profile picture, please try again later');
145150
return;
@@ -149,9 +154,13 @@ class Profile extends React.Component {
149154
options.keyPrefix + file.name;
150155
}
151156

157+
this.setState({wait: true})
158+
152159
UpdateUserMutation(userForm.id, userForm.name,
153160
userForm.bio, profilePicUrl, techs, oldTechsIds,
154161
async (err, res) => {
162+
this.setState({wait: false})
163+
155164
if(err) {
156165
console.log('Error while updating Profile', err);
157166
alert('Error while updating Profile: ' + err);
@@ -256,7 +265,7 @@ class Profile extends React.Component {
256265
label="EMAIL"
257266
value={user.email}
258267
onChange={(v) => this._setUserField('email', v)}
259-
readOnly={!edit} />
268+
readOnly={true} />
260269
</View>
261270
</View>
262271

@@ -308,13 +317,18 @@ class Profile extends React.Component {
308317
</Text>
309318
</TouchableOpacity> : null }
310319
</View> : null}
311-
312-
{ edit ? <View>
313-
<Button title={'Submit Profile Update'}
314-
onPress={this._submitProfile} />
315-
</View> : null}
316320
</View>
317321
</ScrollView>
322+
323+
{ edit ? <View>
324+
<TouchableOpacity
325+
style={main.bottomPrimaryButton}
326+
onPress={!this.state.wait ? this._submitProfile : () => null} >
327+
<Text style={main.primaryButtonText}>
328+
{this.state.wait ? 'Please wait...' : 'Submit' }
329+
</Text>
330+
</TouchableOpacity>
331+
</View> : null}
318332
</View>
319333
);
320334
}

src/components/Signup.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export default class Signup extends React.Component {
360360
onError={console.warn}
361361
/>
362362

363-
return <View style={{paddingVertical: 65,
363+
return <View style={{paddingVertical: 35,
364364
width: '100%',height: '100%',
365365
alignItems: 'center'}}>
366366
<View style={{
@@ -374,9 +374,9 @@ export default class Signup extends React.Component {
374374
style={{flex: 10}}
375375
source={require('../../assets/images/Background.jpg')} />
376376
</View>
377-
<Text style={{fontFamily: 'space-mono-bold', fontSize: 32, color: 'white'}}>WHERE THE HACK</Text>
377+
<Text style={{fontFamily: 'space-mono-bold', fontSize: 32, color: 'white', marginTop: 30}}>WHERE THE HACK</Text>
378378
<Text style={{fontFamily: 'open-sans', color: 'white', textAlign: 'center',
379-
marginTop: 20, marginBottom: 60, fontSize: 22,}}>
379+
marginTop: 10, marginBottom: 20, fontSize: 22,}}>
380380
It's a New and Fun Way to
381381
{"\n"}Empower Your Network and
382382
{"\n"}Finish Your Projects

0 commit comments

Comments
 (0)