Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import {StyleSheet, View, Text, TextInput, AsyncStorage, Image } from 'react-native';
- import { Button,CardItem } from 'native-base'
- import Axios from 'axios';
- class Promotions extends Component {
- constructor(props) {
- super(props);
- this.state = {
- // // treatement_id= '',
- // title= '',
- // desc= '',
- // image='',
- // token= ''
- }
- }
- async componentDidMount() {
- const token = await AsyncStorage.getItem('token')
- Axios({
- method: 'get',
- url: 'http://192.168.56.1/vzuu/public/api/promotions',
- dataType: 'json',
- headers: {
- 'Accept' : 'application/json',
- 'Content-Type': 'application/json',
- 'Authorization': 'Bearer ' + token,
- },
- })
- .then(function (response) {
- console.log(response.data);
- })
- .catch(function(error) {
- console.log(error);
- })
- }
- render() {
- return(
- <View>
- <CardItem>
- <Image />
- </CardItem>
- <CardItem>
- <Text />
- </CardItem>
- </View>
- )
- }
- }
- export default Promotions;
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center'
- },
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement