Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-090 frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-090
2021-090 frontend
Commits
e9ee053a
Commit
e9ee053a
authored
Nov 24, 2021
by
pramod.nichelabs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auction list page api added
parent
1900eeee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
13 deletions
+53
-13
components/auction.stake.component.js
components/auction.stake.component.js
+10
-2
components/auction_item.component.js
components/auction_item.component.js
+1
-1
screen/Auctions.List.Screen.js
screen/Auctions.List.Screen.js
+20
-5
screen/User.Auctions.Screen.js
screen/User.Auctions.Screen.js
+22
-5
No files found.
components/auction.stake.component.js
View file @
e9ee053a
...
...
@@ -4,9 +4,17 @@ import themeColors from '../assets/colors';
export
const
AppStakeItem
=
(
props
)
=>
{
const
[
bid
,
setBid
]
=
useState
({});
const
initialValues
=
{
id
:
"
1
"
,
name
:
"
Saman
"
,
bidprice
:
908
}
useEffect
(()
=>
{
setBid
(
props
.
bid
)
if
(
props
.
bid
===
undefined
)
{
setBid
(
initialValues
)
}
else
{
setBid
(
props
.
bid
)
}
},
[])
return
(
<
View
style
=
{
styles
.
stake
}
>
...
...
components/auction_item.component.js
View file @
e9ee053a
...
...
@@ -17,7 +17,7 @@ export const AppAuctionItem = props => {
<
View
>
{
props
.
delete
?
(
<
View
style
=
{
styles
.
container
}
>
<
TouchableOpacity
onPress
=
{
props
.
on
Select
}
style
=
{
styles
.
button
}
>
<
TouchableOpacity
onPress
=
{
props
.
on
Press
}
style
=
{
styles
.
button
}
>
<
Text
style
=
{
styles
.
label
}
>
{
props
.
label
}
<
/Text
>
<
AppCountDownTimer
secs
=
{
secs
}
/
>
<
/TouchableOpacity
>
...
...
screen/Auctions.List.Screen.js
View file @
e9ee053a
...
...
@@ -6,16 +6,31 @@ import themeColors from '../assets/colors';
import
{
AuctionBottomTab
}
from
'
../Navigations/AuctionBottomTab
'
;
const
AuctionListScreen
=
({
navigation
})
=>
{
const
[
auctions
,
setAuctions
]
=
useState
([]);
useEffect
(()
=>
{
axios
.
get
(
"
http://127.0.0.1:8085/auctions
"
)
.
then
(
async
function
(
response
)
{
setAuctions
(
response
.
data
);
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
},
[])
return
(
<
View
style
=
{
styles
.
container
}
>
<
AppContainer
>
<
Text
style
=
{
styles
.
auctionHeading
}
>
Auctions
List
<
/Text
>
<
Text
style
=
{
styles
.
auctionHeading
}
>
Auctions
<
/Text
>
<
ScrollView
>
<
View
>
<
AppAuctionItem
label
=
'
Auction Item 1
'
onPress
=
{()
=>
navigation
.
navigate
(
"
SignUp
"
)}
/
>
<
AppAuctionItem
label
=
'
Auction Item 2
'
/>
<
AppAuctionItem
label
=
'
Auction Item 3
'
/>
<
AppAuctionItem
label
=
'
Auction Item 4
'
/>
{
auctions
.
map
((
auction
)
=>
{
return
(
<
AppAuctionItem
label
=
{
auction
.
name
}
expire
=
{
auction
.
expire_date
}
onPress
=
{()
=>
navigation
.
navigate
(
"
AuctionDetailScreen
"
,
{
auctionObject
:
auction
})
}
/
>
)
})}
<
/View
>
<
/ScrollView
>
<
/AppContainer
>
...
...
screen/User.Auctions.Screen.js
View file @
e9ee053a
import
React
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
{
View
,
StyleSheet
,
Text
,
ScrollView
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
AppAuctionItem
}
from
'
../components/auction_item.component
'
;
import
{
AppContainer
}
from
'
../container/container
'
;
...
...
@@ -7,6 +8,17 @@ import { AuctionBottomTab } from '../Navigations/AuctionBottomTab';
import
{
MaterialIcons
}
from
'
@expo/vector-icons
'
;
const
UserAuctionListScreen
=
({
navigation
})
=>
{
const
[
auctions
,
setAuctions
]
=
useState
([]);
useEffect
(()
=>
{
axios
.
get
(
"
http://127.0.0.1:8085/auctions
"
)
.
then
(
async
function
(
response
)
{
setAuctions
(
response
.
data
);
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
},
[])
return
(
<
View
style
=
{
styles
.
container
}
>
<
AppContainer
>
...
...
@@ -17,10 +29,15 @@ const UserAuctionListScreen = ({navigation}) => {
<
/TouchableOpacity
>
<
/View
>
<
ScrollView
>
<
AppAuctionItem
label
=
'
Auction Item 178
'
delete
onSelect
=
{()
=>
navigation
.
navigate
(
"
AuctionDetailScreen
"
)}
/
>
<
AppAuctionItem
label
=
'
Auction Item 2
'
delete
/
>
<
AppAuctionItem
label
=
'
Auction Item 3
'
delete
/
>
<
AppAuctionItem
label
=
'
Auction Item 4
'
delete
/
>
{
auctions
.
map
((
auction
)
=>
{
return
(
<
AppAuctionItem
delete
label
=
{
auction
.
name
}
expire
=
{
auction
.
expire_date
}
onPress
=
{()
=>
navigation
.
navigate
(
"
AuctionDetailScreen
"
,
{
auctionObject
:
auction
})
}
/
>
)
})}
<
/ScrollView
>
<
/AppContainer
>
<
AuctionBottomTab
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment