Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
Feature: AboutScreen - load contributors from JSON file
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Feb 24, 2018
1 parent 7ed3b37 commit afd9c0a
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 100 deletions.
41 changes: 15 additions & 26 deletions containers/AboutScreen/AboutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { View, StyleSheet, Text, TouchableOpacity } from 'react-native';
import { connect } from 'react-redux';
import { Avatar } from 'components';
import { getVersion } from 'react-native-device-info';
import { team, contributors } from 'utils/team';
import contributors from 'res/contributors.json';
import { showProfile } from 'actions';

type Props = {
Expand All @@ -24,24 +24,19 @@ class AboutScreen extends PureComponent<Props> {
<View style={styles.header}>
<Text style={styles.title}>GHubber (v{version})</Text>
</View>
<View style={styles.team}>
<Text style={styles.teamTitle}>Creator</Text>
<TouchableOpacity onPress={() => showProfile(team[0].login)} style={styles.member}>
<Avatar user={team[0]} size={250} />
<Text style={styles.teamMemberName}>{team[0].name}@{team[0].login}</Text>
</TouchableOpacity>
</View>
<View style={styles.contributors}>
<Text style={styles.contributorsTitle}>Our Awesome Contributors</Text>
{
contributors.map(
(user) => (
<TouchableOpacity onPress={() => showProfile(user.login)} key={user.id}>
<Avatar user={user} size={50} />
</TouchableOpacity>
<View style={styles.contributorsRow}>
{
contributors.map(
(user) => (
<TouchableOpacity onPress={() => showProfile(user.login)} key={user.id}>
<Avatar user={user} size={50} />
</TouchableOpacity>
)
)
)
}
}
</View>
</View>
</View>
);
Expand All @@ -61,10 +56,7 @@ const styles = StyleSheet.create({
fontSize: 24
},
header: {
flex: 0,
alignItems: 'center'
},
team: {
marginVertical: 15,
flex: 0,
alignItems: 'center'
},
Expand All @@ -73,12 +65,9 @@ const styles = StyleSheet.create({
alignItems: 'center',
marginVertical: 25
},
teamTitle: {
fontSize: 24
},
teamMemberName: {
fontSize: 20,
textAlign: 'center'
contributorsRow: {
flex: 1,
flexDirection: 'row'
},
});

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint": "eslint --cache .",
"lint:staged": "staged-files '**/*.js' -- $(npm bin)/eslint",
"postversion": "react-native-version",
"postinstall": "rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json"
"postinstall": "rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json",
"contributors": "curl https://api.github.com/repos/ovr/ghubber/contributors > res/contributors.json"
},
"pre-commit": {
"run": "lint:staged"
Expand Down
182 changes: 182 additions & 0 deletions res/contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
[
{
"login": "ovr",
"id": 572096,
"avatar_url": "https://avatars3.githubusercontent.com/u/572096?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ovr",
"html_url": "https://github.com/ovr",
"followers_url": "https://api.github.com/users/ovr/followers",
"following_url": "https://api.github.com/users/ovr/following{/other_user}",
"gists_url": "https://api.github.com/users/ovr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ovr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ovr/subscriptions",
"organizations_url": "https://api.github.com/users/ovr/orgs",
"repos_url": "https://api.github.com/users/ovr/repos",
"events_url": "https://api.github.com/users/ovr/events{/privacy}",
"received_events_url": "https://api.github.com/users/ovr/received_events",
"type": "User",
"site_admin": false,
"contributions": 512
},
{
"login": "lex111",
"id": 4408379,
"avatar_url": "https://avatars2.githubusercontent.com/u/4408379?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lex111",
"html_url": "https://github.com/lex111",
"followers_url": "https://api.github.com/users/lex111/followers",
"following_url": "https://api.github.com/users/lex111/following{/other_user}",
"gists_url": "https://api.github.com/users/lex111/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lex111/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lex111/subscriptions",
"organizations_url": "https://api.github.com/users/lex111/orgs",
"repos_url": "https://api.github.com/users/lex111/repos",
"events_url": "https://api.github.com/users/lex111/events{/privacy}",
"received_events_url": "https://api.github.com/users/lex111/received_events",
"type": "User",
"site_admin": false,
"contributions": 27
},
{
"login": "quique",
"id": 8809,
"avatar_url": "https://avatars2.githubusercontent.com/u/8809?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/quique",
"html_url": "https://github.com/quique",
"followers_url": "https://api.github.com/users/quique/followers",
"following_url": "https://api.github.com/users/quique/following{/other_user}",
"gists_url": "https://api.github.com/users/quique/gists{/gist_id}",
"starred_url": "https://api.github.com/users/quique/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/quique/subscriptions",
"organizations_url": "https://api.github.com/users/quique/orgs",
"repos_url": "https://api.github.com/users/quique/repos",
"events_url": "https://api.github.com/users/quique/events{/privacy}",
"received_events_url": "https://api.github.com/users/quique/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
},
{
"login": "hejty",
"id": 6890321,
"avatar_url": "https://avatars1.githubusercontent.com/u/6890321?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hejty",
"html_url": "https://github.com/hejty",
"followers_url": "https://api.github.com/users/hejty/followers",
"following_url": "https://api.github.com/users/hejty/following{/other_user}",
"gists_url": "https://api.github.com/users/hejty/gists{/gist_id}",
"starred_url": "https://api.github.com/users/hejty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hejty/subscriptions",
"organizations_url": "https://api.github.com/users/hejty/orgs",
"repos_url": "https://api.github.com/users/hejty/repos",
"events_url": "https://api.github.com/users/hejty/events{/privacy}",
"received_events_url": "https://api.github.com/users/hejty/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
},
{
"login": "Prestaul",
"id": 181918,
"avatar_url": "https://avatars0.githubusercontent.com/u/181918?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Prestaul",
"html_url": "https://github.com/Prestaul",
"followers_url": "https://api.github.com/users/Prestaul/followers",
"following_url": "https://api.github.com/users/Prestaul/following{/other_user}",
"gists_url": "https://api.github.com/users/Prestaul/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Prestaul/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Prestaul/subscriptions",
"organizations_url": "https://api.github.com/users/Prestaul/orgs",
"repos_url": "https://api.github.com/users/Prestaul/repos",
"events_url": "https://api.github.com/users/Prestaul/events{/privacy}",
"received_events_url": "https://api.github.com/users/Prestaul/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
},
{
"login": "rafajaques",
"id": 2057848,
"avatar_url": "https://avatars0.githubusercontent.com/u/2057848?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rafajaques",
"html_url": "https://github.com/rafajaques",
"followers_url": "https://api.github.com/users/rafajaques/followers",
"following_url": "https://api.github.com/users/rafajaques/following{/other_user}",
"gists_url": "https://api.github.com/users/rafajaques/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rafajaques/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rafajaques/subscriptions",
"organizations_url": "https://api.github.com/users/rafajaques/orgs",
"repos_url": "https://api.github.com/users/rafajaques/repos",
"events_url": "https://api.github.com/users/rafajaques/events{/privacy}",
"received_events_url": "https://api.github.com/users/rafajaques/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
},
{
"login": "RomanValihura",
"id": 17511584,
"avatar_url": "https://avatars3.githubusercontent.com/u/17511584?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/RomanValihura",
"html_url": "https://github.com/RomanValihura",
"followers_url": "https://api.github.com/users/RomanValihura/followers",
"following_url": "https://api.github.com/users/RomanValihura/following{/other_user}",
"gists_url": "https://api.github.com/users/RomanValihura/gists{/gist_id}",
"starred_url": "https://api.github.com/users/RomanValihura/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/RomanValihura/subscriptions",
"organizations_url": "https://api.github.com/users/RomanValihura/orgs",
"repos_url": "https://api.github.com/users/RomanValihura/repos",
"events_url": "https://api.github.com/users/RomanValihura/events{/privacy}",
"received_events_url": "https://api.github.com/users/RomanValihura/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
},
{
"login": "markainick",
"id": 15358419,
"avatar_url": "https://avatars3.githubusercontent.com/u/15358419?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/markainick",
"html_url": "https://github.com/markainick",
"followers_url": "https://api.github.com/users/markainick/followers",
"following_url": "https://api.github.com/users/markainick/following{/other_user}",
"gists_url": "https://api.github.com/users/markainick/gists{/gist_id}",
"starred_url": "https://api.github.com/users/markainick/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/markainick/subscriptions",
"organizations_url": "https://api.github.com/users/markainick/orgs",
"repos_url": "https://api.github.com/users/markainick/repos",
"events_url": "https://api.github.com/users/markainick/events{/privacy}",
"received_events_url": "https://api.github.com/users/markainick/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
},
{
"login": "quatroka",
"id": 11038791,
"avatar_url": "https://avatars1.githubusercontent.com/u/11038791?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/quatroka",
"html_url": "https://github.com/quatroka",
"followers_url": "https://api.github.com/users/quatroka/followers",
"following_url": "https://api.github.com/users/quatroka/following{/other_user}",
"gists_url": "https://api.github.com/users/quatroka/gists{/gist_id}",
"starred_url": "https://api.github.com/users/quatroka/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/quatroka/subscriptions",
"organizations_url": "https://api.github.com/users/quatroka/orgs",
"repos_url": "https://api.github.com/users/quatroka/repos",
"events_url": "https://api.github.com/users/quatroka/events{/privacy}",
"received_events_url": "https://api.github.com/users/quatroka/received_events",
"type": "User",
"site_admin": false,
"contributions": 1
}
]
1 change: 0 additions & 1 deletion utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * from './save-state-key';
export * from './images';
export * from './errors';
export * from './filters';
export * from './team';
export * from './filter-concat';
export * from './i18n';
export * from './moment';
Expand Down
72 changes: 0 additions & 72 deletions utils/team.js

This file was deleted.

0 comments on commit afd9c0a

Please sign in to comment.