Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sp21-cs242-assignment3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zshan2
sp21-cs242-assignment3
Merge requests
!2
Assignment 3.1
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Assignment 3.1
assignment-3.1
into
master
Overview
0
Commits
4
Pipelines
0
Changes
37
Merged
zshan2
requested to merge
assignment-3.1
into
master
3 years ago
Overview
0
Commits
4
Pipelines
0
Changes
37
Expand
Final submission
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
06f3386a
4 commits,
3 years ago
37 files
+
2418
−
124
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
37
Search (e.g. *.vue) (Ctrl+P)
src/Components/Followers.js
0 → 100644
+
56
−
0
Options
import
*
as
React
from
'
react
'
;
import
{
Pressable
,
View
,
Text
,
Image
,
StyleSheet
}
from
'
react-native
'
;
import
Users
from
'
./Users
'
const
styles
=
StyleSheet
.
create
({
viewStyleVertical
:
{
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
margin
:
'
10%
'
},
viewStyleHorizon
:
{
flex
:
1
,
flexDirection
:
'
row
'
,
justifyContent
:
'
space-between
'
},
pressableStyle
:
{
flex
:
1
,
flexDirection
:
'
row
'
,
justifyContent
:
'
space-between
'
,
backgroundColor
:
'
lavender
'
,
paddingHorizontal
:
20
,
paddingVertical
:
10
,
borderColor
:
'
thistle
'
,
borderWidth
:
2
,
borderRadius
:
5
,
marginHorizontal
:
10
,
marginTop
:
10
},
image
:
{
flex
:
1
,
resizeMode
:
"
cover
"
,
justifyContent
:
"
center
"
},
container
:
{
flex
:
1
},
textBox
:
{
flex
:
1
,
marginTop
:
20
,
backgroundColor
:
'
white
'
,
borderColor
:
'
black
'
,
borderWidth
:
2
,
borderRadius
:
5
,
marginHorizontal
:
10
,
paddingVertical
:
10
,
paddingHorizontal
:
50
,
alignItems
:
'
flex-start
'
}
});
function
Followers
(
user
,
navigation
)
{
const
nodes
=
user
[
'
followers
'
][
'
nodes
'
]
const
login
=
user
[
'
login
'
]
let
cards
=
[]
if
(
nodes
.
length
===
0
)
{
cards
.
push
(
<
Pressable
style
=
{
styles
.
textBox
}
key
=
{
'
Nobody
'
}
>
<
Text
style
=
{{
fontSize
:
30
}}
>
Oops
!
Nobody
is
in
this
list
!
<
/Text>
<
/Pressable
>
)
}
else
{
for
(
let
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
var
name
=
'
Name:
\n
'
+
nodes
[
i
][
'
name
'
]
+
'
\n
'
var
userName
=
'
Github Username:
\n
'
+
nodes
[
i
][
'
login
'
]
+
'
\n
'
var
key
=
'
user#
'
+
i
var
avatarUrl
=
nodes
[
i
][
'
avatarUrl
'
]
cards
.
push
(
<
Pressable
style
=
{
styles
.
textBox
}
key
=
{
key
}
onPress
=
{()
=>
navigation
.
push
(
'
LoadingProfile
'
,
{
login
:
nodes
[
i
][
'
login
'
]})}
>
<
View
style
=
{
styles
.
viewStyleVertical
}
>
<
Image
style
=
{{
width
:
90
,
height
:
90
}}
source
=
{{
uri
:
avatarUrl
}}
/
>
<
/View
>
<
View
style
=
{
styles
.
viewStyleVertical
}
>
<
Text
>
{
name
}
<
/Text
>
<
Text
>
{
userName
}
<
/Text
>
<
/View
>
<
/Pressable
>
)
}
}
const
dataFile
=
{}
dataFile
[
'
cards
'
]
=
cards
dataFile
[
'
navi
'
]
=
navigation
dataFile
[
'
login
'
]
=
login
return
(
<
Users
data
=
{
dataFile
}
/
>
);
}
export
default
Followers
\ No newline at end of file
Loading