Skip to content

Commit

Permalink
Merge branch 'master' into pr/31
Browse files Browse the repository at this point in the history
  • Loading branch information
hopetambala committed Jul 27, 2020
2 parents e1aa941 + 9cfd98f commit fe3f677
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 120 deletions.
File renamed without changes.
File renamed without changes.
119 changes: 75 additions & 44 deletions screens/HomeScreen.js → screens/HomeScreen/index.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,106 @@
import * as React from 'react';
import React from 'react';
import {
Platform, StyleSheet, Text, TouchableOpacity, View
} from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';

import retrieveHelloFunction from '../services/parse/crud';
import retrieveHelloFunction from '../../services/parse/crud';
import {
retrieveSignUpFunction, retrieveSignInFunction, retrieveSignOutFunction,
retrieveForgotPasswordFunction, retrieveCurrentUserFunction, retrieveDeleteUserFunction
} from '../services/parse/auth';
import retrievePuenteAutofillData from '../services/aws';
// import Autocomplete from 'react-native-autocomplete-input';
import AutoFill from '../components/AutoFill';

import { getTasks } from '../../services/tasky';

export default function HomeScreen() {
return (
<ScrollView style={styles.container} contentContainerStyle={styles.contentContainer}>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleHelpPress} style={styles.helpLink}>
<Text style={styles.text}>HomeScreen</Text>
</TouchableOpacity>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleSignUpPress} style={styles.helpLink}>
<Text style={styles.text}>Sign Up</Text>
</TouchableOpacity>
</View>
</View>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleSignInPress} style={styles.helpLink}>
<Text style={styles.text}>Sign In</Text>
</TouchableOpacity>

export default class HomeScreen extends React.Component {
constructor() {
super();
this.state = {
tasks: null
};
}

showTasks = async () => {
await getTasks().then((result) => {
this.setState({
tasks: result
});
});
}

render() {
return (
<ScrollView style={styles.container} contentContainerStyle={styles.contentContainer}>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleHelpPress} style={styles.helpLink}>
<Text style={styles.text}>HomeScreen</Text>
</TouchableOpacity>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleSignUpPress} style={styles.helpLink}>
<Text style={styles.text}>Sign Up</Text>
</TouchableOpacity>
</View>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleSignOutPress} style={styles.helpLink}>
<Text style={styles.text}>Sign Out</Text>
</TouchableOpacity>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleSignInPress} style={styles.helpLink}>
<Text style={styles.text}>Sign In</Text>
</TouchableOpacity>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleSignOutPress} style={styles.helpLink}>
<Text style={styles.text}>Sign Out</Text>
</TouchableOpacity>
</View>
</View>
</View>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleForgotPasswordPress} style={styles.helpLink}>
<Text style={styles.text}>Forgot Password</Text>
</TouchableOpacity>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleForgotPasswordPress} style={styles.helpLink}>
<Text style={styles.text}>Forgot Password</Text>
</TouchableOpacity>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleCurrentUserPress} style={styles.helpLink}>
<Text style={styles.text}>Current User</Text>
</TouchableOpacity>
</View>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleCurrentUserPress} style={styles.helpLink}>
<Text style={styles.text}>Current User</Text>
</TouchableOpacity>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleDeleteUserPress} style={styles.helpLink}>
<Text style={styles.text}>Delete User</Text>
</TouchableOpacity>
</View>
</View>
</View>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleDeleteUserPress} style={styles.helpLink}>
<Text style={styles.text}>Delete User</Text>
</TouchableOpacity>
<View style={styles.row}>
<View style={styles.clickText}>
<TouchableOpacity onPress={this.showTasks} style={styles.helpLink}>
<Text style={styles.text}>Tasks</Text>
{this.state.tasks != null
&& this.state.tasks.map((task, i) => (
<View key={i}>
<Text>{task.name}</Text>
</View>
))}
</TouchableOpacity>
</View>
</View>
<View style={styles.clickText}>
<TouchableOpacity onPress={handleAutoFillClick} style={styles.helpLink}>
<Text style={styles.text}>Autofill GET</Text>
</TouchableOpacity>
</View>
</View>
<AutoFill parameter="City" />
<AutoFill parameter="Province" />
<AutoFill parameter="Communities" />
</ScrollView>
);
}
}

function handleHelpPress() {
Expand Down
76 changes: 0 additions & 76 deletions screens/LinksScreen.js

This file was deleted.

5 changes: 5 additions & 0 deletions services/tasky/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { getTasks } from './tasks';

export {
getTasks
};
19 changes: 19 additions & 0 deletions services/tasky/tasks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import axios from 'axios';
import getEnvVars from '../../../environment';


function getTasks() {
const { taskyUrlApi } = getEnvVars();

return axios.get(`${taskyUrlApi}/tasks`)
.then(async (response) => {
const data = await response.data.tasks;
return data;
})
.catch((error) => {
console.log(error);
});
}


export { getTasks };
Empty file removed services/twilio/index.js
Empty file.

0 comments on commit fe3f677

Please sign in to comment.