1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import React, { Component } from "react";
- import { Text, View, StyleSheet, Button } from "react-native";
-
- export default class ProfileScreen extends Component {
- prueba = async()=>{
- let response = await fetch('http://05cb04aa6bc5.ngrok.io/api/hello',{
- method: 'GET',
- headers: {
- Authorization: 'Token c33cc0e20cdf09a12d1e3e3de2515f3e9f2fd008'
- }
- })
- let responseJson = await response.json()
- console.log(responseJson)
- }
- render() {
- return (
- <View style={styles.container}>
- <Text> Profile Screen </Text>
- <Text style={{ fontSize: 20, fontWeight: "bold" }}>
- Welcome, {this.props.navigation.getParam("username")}
- </Text>
- <Button
- title="Sign out"
- onPress={() => this.props.navigation.navigate("Login")}
- />
- <Button
- title="Test"
- onPress={this.prueba}
- />
-
- <Button
- title="Add Taken Course"
- onPress= {() => this.props.navigation.navigate("AddTakenCourse")}
- />
-
- <Button
- title="Settings"
- onPress= {() => this.props.navigation.navigate("Settings")}
- />
-
- </View>
- );
- }
- }
-
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: "#fff",
- alignItems: "center",
- justifyContent: "center"
- }
- });
|