Commit 5f01fe02 authored by pramod.nichelabs's avatar pramod.nichelabs

get bids functionality added

parent c5efe094
// Example of Splash, Login and Sign Up in React Native
// https://aboutreact.com/react-native-login-and-signup/
// Import React and Component
import React from 'react';
import React, {useState, useEffect} from 'react';
import axios from 'axios';
import {View, StyleSheet, Text, ScrollView} from 'react-native';
import { AppContainer } from '../container/container';
import themeColors from '../assets/colors';
......@@ -10,16 +7,28 @@ import { AuctionBottomTab } from '../Navigations/AuctionBottomTab';
import { AppStakeItem } from '../components/auction.stake.component';
const UserBidScreen = ({navigation}) => {
const [bids, setBids] = useState([]);
useEffect(() => {
axios.get("http://127.0.0.1:8085/bids")
.then( async function (response) {
setBids(response.data);
console.log(response.data);
})
.catch(function (error) {
console.log(error);
})
}, [])
return (
<View style={styles.container}>
<AppContainer>
<Text style={styles.auctionHeading}>My Bids</Text>
<ScrollView>
<AppStakeItem />
<AppStakeItem />
<AppStakeItem />
<AppStakeItem />
<AppStakeItem />
{bids.map((bid) => {
return(
<AppStakeItem bid={bid} />
)
})}
</ScrollView>
</AppContainer>
<AuctionBottomTab/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment