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 import React, {useState, useEffect} from 'react';
// https://aboutreact.com/react-native-login-and-signup/ import axios from 'axios';
// Import React and Component
import React from 'react';
import {View, StyleSheet, Text, ScrollView} from 'react-native'; import {View, StyleSheet, Text, ScrollView} from 'react-native';
import { AppContainer } from '../container/container'; import { AppContainer } from '../container/container';
import themeColors from '../assets/colors'; import themeColors from '../assets/colors';
...@@ -10,16 +7,28 @@ import { AuctionBottomTab } from '../Navigations/AuctionBottomTab'; ...@@ -10,16 +7,28 @@ import { AuctionBottomTab } from '../Navigations/AuctionBottomTab';
import { AppStakeItem } from '../components/auction.stake.component'; import { AppStakeItem } from '../components/auction.stake.component';
const UserBidScreen = ({navigation}) => { 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 ( return (
<View style={styles.container}> <View style={styles.container}>
<AppContainer> <AppContainer>
<Text style={styles.auctionHeading}>My Bids</Text> <Text style={styles.auctionHeading}>My Bids</Text>
<ScrollView> <ScrollView>
<AppStakeItem /> {bids.map((bid) => {
<AppStakeItem /> return(
<AppStakeItem /> <AppStakeItem bid={bid} />
<AppStakeItem /> )
<AppStakeItem /> })}
</ScrollView> </ScrollView>
</AppContainer> </AppContainer>
<AuctionBottomTab/> <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