Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022_223_Digi Bus
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
1
Merge Requests
1
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
Gunasekara M.A.L.M
2022_223_Digi Bus
Commits
f6bf28f0
Commit
f6bf28f0
authored
Oct 07, 2022
by
Gunasekara M.A.L.M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create bus_list.js
parent
c7a57f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
163 additions
and
0 deletions
+163
-0
digibus/src/screen/bus_list_screen/buslistscreen.js
digibus/src/screen/bus_list_screen/buslistscreen.js
+163
-0
No files found.
digibus/src/screen/bus_list_screen/buslistscreen.js
0 → 100644
View file @
f6bf28f0
import
React
,
{
PropTypes
,
Component
,
useState
,
useEffect
,
useCallback
}
from
'
react
'
;
import
{
View
,
StyleSheet
,
Text
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
widthPercentageToDP
as
wp
,
heightPercentageToDP
as
hp
}
from
'
react-native-responsive-screen
'
;
import
{
Actions
}
from
'
react-native-router-flux
'
;
const
BusInfo
=
({
busNum
,
onBord
,
avlaibe
,
price
})
=>
{
function
viewOnMap
()
{
Actions
.
mapScreen
();
}
return
(
<
View
style
=
{
style
.
busCardHodler
}
>
<
View
style
=
{
style
.
busCardContainer
}
>
<
View
style
=
{
style
.
busInfo_holder
}
>
<
View
style
=
{
style
.
busInfo_01
}
>
<
Text
style
=
{
style
.
busInfo_tite
}
>
{
'
Bus Number
'
+
`
${
busNum
}
`
}
<
/Text
>
<
/View
>
<
View
style
=
{
style
.
busInfo_02
}
>
<
View
style
=
{
style
.
businfoContainer_row01
}
>
<
Text
style
=
{
style
.
busInfo_info1
}
>
{
'
Passenger on Bord
'
+
`
${
onBord
}
`
}
<
/Text
>
<
Text
style
=
{[
style
.
busInfo_info1
,
{
color
:
'
#d00000
'
}]}
>
{
'
Avaliabe Seat
'
+
`
${
avlaibe
}
`
}
<
/Text
>
<
/View
>
<
View
style
=
{
style
.
businfoContainer_row02
}
>
<
Text
style
=
{
style
.
busInfo_info2
}
>
{
'
Rs
'
+
`
${
price
}
`
+
'
.00
'
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{
style
.
busMap
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
viewOnMap
();
}}
>
<
View
style
=
{
style
.
busMapholder
}
>
<
Text
style
=
{[
style
.
busInfo_tite
,
{
fontWeight
:
'
400
'
}]}
>
View
On
Map
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
)
}
const
BusListScreen
=
()
=>
{
const
[
busList
,
setBusList
]
=
useState
([
{
"
id
"
:
1
,
"
busNum
"
:
"
LL-7756
"
,
"
onBord
"
:
33
,
"
avlable
"
:
21
,
"
price
"
:
150
},
// { "id": 2, "busNum": "LG-6511", "onBord": 10, "avlable": 44, "price": 150 },
// { "id": 3, "busNum": "NB-9623", "onBord": 3, "avlable": 51, "price": 150 },
]);
return
(
<
View
style
=
{
style
.
main
}
>
<
View
style
=
{
style
.
container
}
>
{
busList
.
map
((
bus
)
=>
{
return
(
<
BusInfo
busNum
=
{
bus
.
busNum
}
avlaibe
=
{
bus
.
avlable
}
onBord
=
{
bus
.
onBord
}
price
=
{
bus
.
price
}
/
>
)
})
}
<
/View
>
<
/View
>
)
}
const
style
=
StyleSheet
.
create
({
main
:
{
flex
:
1
,
backgroundColor
:
'
#fff
'
},
container
:
{
height
:
hp
(
'
100%
'
),
width
:
wp
(
'
100%
'
),
alignItems
:
'
center
'
,
},
busCardHodler
:
{
height
:
hp
(
'
25%
'
),
width
:
wp
(
'
96%
'
),
alignItems
:
'
center
'
,
borderRadius
:
wp
(
'
5%
'
),
backgroundColor
:
'
#fff
'
,
marginTop
:
hp
(
'
1.5%
'
),
},
busCardContainer
:
{
height
:
hp
(
'
20%
'
),
width
:
wp
(
'
94%
'
),
alignItems
:
'
center
'
,
},
busInfo_holder
:
{
height
:
hp
(
'
18%
'
),
width
:
wp
(
'
94%
'
),
alignItems
:
'
center
'
,
backgroundColor
:
'
#00186C
'
,
borderRadius
:
wp
(
'
5%
'
),
},
busInfo_01
:
{
height
:
hp
(
'
4%
'
),
width
:
wp
(
'
94%
'
),
alignItems
:
'
center
'
,
},
busInfo_tite
:
{
fontSize
:
20
,
fontWeight
:
'
500
'
,
color
:
'
#fff
'
},
busInfo_02
:
{
height
:
hp
(
'
8%
'
),
width
:
wp
(
'
94%
'
),
alignItems
:
'
flex-start
'
,
flexDirection
:
'
row
'
,
},
businfoContainer_row01
:
{
height
:
hp
(
'
8%
'
),
width
:
wp
(
'
58%
'
),
alignItems
:
'
center
'
,
backgroundColor
:
'
#fff
'
,
justifyContent
:
'
center
'
,
marginRight
:
wp
(
'
2%
'
),
marginLeft
:
wp
(
'
2%
'
),
borderRadius
:
wp
(
'
3%
'
)
},
businfoContainer_row02
:
{
height
:
hp
(
'
8%
'
),
width
:
wp
(
'
28%
'
),
alignItems
:
'
center
'
,
backgroundColor
:
'
#C4C4C4
'
,
marginLeft
:
wp
(
'
2%
'
),
justifyContent
:
'
center
'
,
borderRadius
:
wp
(
'
3%
'
)
},
busMap
:
{
height
:
hp
(
'
8%
'
),
width
:
wp
(
'
94%
'
),
alignItems
:
'
center
'
,
},
busMapholder
:
{
height
:
hp
(
'
6%
'
),
width
:
wp
(
'
94%
'
),
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
backgroundColor
:
'
#fc7802
'
,
borderRadius
:
wp
(
'
5%
'
)
},
busInfo_info1
:
{
fontSize
:
20
,
fontWeight
:
'
400
'
,
color
:
'
#000
'
},
busInfo_info2
:
{
fontSize
:
20
,
fontWeight
:
'
400
'
,
color
:
'
#001d3d
'
},
});
export
default
BusListScreen
;
\ 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