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
23dac084
Commit
23dac084
authored
Oct 11, 2021
by
Pramodh Rajapakse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
carousel component added to auction detail pae
parent
fe5d897a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
223 additions
and
0 deletions
+223
-0
Navigations/AuthStack.js
Navigations/AuthStack.js
+10
-0
components/carousel.component.js
components/carousel.component.js
+140
-0
screen/Auction.Detail.Screen.js
screen/Auction.Detail.Screen.js
+73
-0
No files found.
Navigations/AuthStack.js
View file @
23dac084
...
...
@@ -14,6 +14,7 @@ import HomeAuctionScreen from "../screen/Home.Auction.Screen";
import
UserAuctionListScreen
from
"
../screen/User.Auctions.Screen
"
;
import
UserBidScreen
from
"
../screen/User.Bids.Screen
"
;
import
AuctionListScreen
from
"
../screen/Auctions.List.Screen
"
;
import
AuctionDetailScreen
from
"
../screen/Auction.Detail.Screen
"
;
const
Stack
=
createStackNavigator
();
...
...
@@ -225,6 +226,15 @@ export function AuthStack({ navigation }) {
headerTitleAlign
:
"
center
"
}}
/
>
<
Stack
.
Screen
name
=
"
AuctionDetailScreen
"
component
=
{
AuctionDetailScreen
}
options
=
{{
headerShown
:
false
,
title
:
"
Auctions List
"
,
headerTitleAlign
:
"
center
"
}}
/
>
<
Stack
.
Screen
name
=
"
AboutUs
"
component
=
{
AboutUs
}
...
...
components/carousel.component.js
0 → 100644
View file @
23dac084
import
React
,
{
Component
}
from
'
react
'
import
{
Animated
,
View
,
StyleSheet
,
Image
,
Dimensions
,
ScrollView
,
Text
}
from
'
react-native
'
import
themeColors
from
'
../assets/colors
'
const
deviceWidth
=
Dimensions
.
get
(
'
window
'
).
width
const
FIXED_BAR_WIDTH
=
100
const
BAR_SPACE
=
10
const
images
=
[
'
https://s-media-cache-ak0.pinimg.com/originals/ee/51/39/ee5139157407967591081ee04723259a.png
'
,
'
https://s-media-cache-ak0.pinimg.com/originals/40/4f/83/404f83e93175630e77bc29b3fe727cbe.jpg
'
,
'
https://s-media-cache-ak0.pinimg.com/originals/8d/1a/da/8d1adab145a2d606c85e339873b9bb0e.jpg
'
,
]
export
default
class
AppCarousel
extends
Component
{
numItems
=
images
.
length
itemWidth
=
(
FIXED_BAR_WIDTH
/
this
.
numItems
)
-
((
this
.
numItems
-
1
)
*
BAR_SPACE
)
animVal
=
new
Animated
.
Value
(
0
)
render
()
{
let
imageArray
=
[]
let
barArray
=
[]
images
.
forEach
((
image
,
i
)
=>
{
console
.
log
(
image
,
i
)
const
thisImage
=
(
<
Image
key
=
{
`image
${
i
}
`
}
source
=
{{
uri
:
image
}}
style
=
{
styles
.
image
}
/
>
)
imageArray
.
push
(
thisImage
)
const
scrollBarVal
=
this
.
animVal
.
interpolate
({
inputRange
:
[
deviceWidth
*
(
i
-
1
),
deviceWidth
*
(
i
+
1
)],
outputRange
:
[
-
this
.
itemWidth
,
this
.
itemWidth
],
extrapolate
:
'
clamp
'
,
})
const
thisBar
=
(
<
View
key
=
{
`bar
${
i
}
`
}
style
=
{[
styles
.
track
,
{
width
:
this
.
itemWidth
,
marginLeft
:
i
===
0
?
0
:
BAR_SPACE
,
},
]}
>
<
Animated
.
View
style
=
{[
styles
.
bar
,
{
width
:
this
.
itemWidth
,
transform
:
[
{
translateX
:
scrollBarVal
},
],
},
]}
/
>
<
/View
>
)
barArray
.
push
(
thisBar
)
})
return
(
<
View
style
=
{
styles
.
container
}
flex
=
{
1
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
scrollEventThrottle
=
{
10
}
pagingEnabled
onScroll
=
{
Animated
.
event
(
[{
nativeEvent
:
{
contentOffset
:
{
x
:
this
.
animVal
}
}
}]
)
}
>
{
imageArray
}
<
View
style
=
{
styles
.
skip
}
>
<
/View
>
<
/ScrollView
>
<
View
style
=
{
styles
.
barContainer
}
>
{
barArray
}
<
/View
>
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
},
barContainer
:
{
position
:
'
absolute
'
,
zIndex
:
2
,
bottom
:
40
,
flexDirection
:
'
row
'
,
},
skip
:
{
position
:
'
absolute
'
,
zIndex
:
2
,
bottom
:
80
,
flexDirection
:
'
row
'
,
},
track
:
{
backgroundColor
:
themeColors
.
SECONDARY_COLOR
,
overflow
:
'
hidden
'
,
height
:
2
,
},
bar
:
{
backgroundColor
:
themeColors
.
WHITE
,
height
:
2
,
position
:
'
absolute
'
,
left
:
0
,
top
:
0
,
},
image
:
{
flex
:
1
,
width
:
deviceWidth
,
borderBottomStartRadius
:
20
,
borderBottomEndRadius
:
20
}
})
\ No newline at end of file
screen/Auction.Detail.Screen.js
0 → 100644
View file @
23dac084
// 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
{
View
,
StyleSheet
,
Text
,
ScrollView
}
from
'
react-native
'
;
import
{
AppAuctionItem
}
from
'
../components/auction_item.component
'
;
import
{
AppContainer
}
from
'
../container/container
'
;
import
themeColors
from
'
../assets/colors
'
;
import
{
AuctionBottomTab
}
from
'
../Navigations/AuctionBottomTab
'
;
import
AppCarousel
from
'
../components/carousel.component
'
;
const
AuctionDetailScreen
=
(
props
,
{
navigation
})
=>
{
return
(
<
View
style
=
{
styles
.
wrapper
}
>
<
View
style
=
{
styles
.
header
}
>
<
AppCarousel
/>
<
/View
>
<
View
style
=
{
styles
.
container
}
>
<
AppContainer
>
<
View
>
<
Text
style
=
{
styles
.
auctionHeading
}
>
Title
<
/Text
>
<
View
>
<
Text
style
=
{
styles
.
auctionHeading
}
>
Lot
No
:
<
/Text
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
auctionHeading
}
>
Last
Stakes
<
/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
'
/>
<
/View
>
<
/ScrollView
>
<
/AppContainer
>
<
AuctionBottomTab
/>
<
/View
>
<
/View
>
);
};
export
default
AuctionDetailScreen
;
const
styles
=
StyleSheet
.
create
({
wrapper
:
{
flex
:
1
,
backgroundColor
:
themeColors
.
WHITE
},
container
:
{
flex
:
1
,
backgroundColor
:
'
#ffffff
'
},
header
:
{
height
:
'
35%
'
,
marginBottom
:
25
,
backgroundColor
:
themeColors
.
PRIMARY_COLOR
,
borderBottomStartRadius
:
20
,
borderBottomEndRadius
:
20
,
},
btnRowContainer
:
{
maxHeight
:
100
},
contentContainer
:
{
flex
:
1
,
flexDirection
:
'
row
'
,
margin
:
20
},
auctionHeading
:
{
fontSize
:
24
,
fontWeight
:
'
bold
'
,
color
:
themeColors
.
SECONDARY_COLOR
}
})
\ No newline at end of file
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