-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f25c50
commit 8a87b4a
Showing
5 changed files
with
81 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Text, View } from 'react-native'; | ||
import Octicons from 'react-native-vector-icons/Octicons'; | ||
|
||
type Props = { | ||
name: string; | ||
color: string; | ||
} | ||
export default (props: Props) => { | ||
const { name, color } = props; | ||
return ( | ||
name !== undefined && | ||
<View style={{ | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
alignSelf: 'flex-start', | ||
borderRadius: 4, | ||
borderWidth: 1, | ||
borderColor: '#e0e0e0', | ||
paddingHorizontal: 8, | ||
paddingVertical: 4, | ||
gap: 8 | ||
}}> | ||
<Octicons testID='badgeIcon' name={"file-code"} color={color} size={14} /> | ||
<Text style={{ color: '#fff', fontSize: 12 }}>{name}</Text> | ||
</View> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { View } from "react-native" | ||
import { Repository } from "../../types/response" | ||
import HasIconBadge from "./HasIconBadge" | ||
import LanguageBadge from "./LanguageBadge" | ||
|
||
type Prop = { | ||
repository: Repository | ||
} | ||
|
||
export default ({ repository }: Prop) => { | ||
return ( | ||
<View style={{ | ||
marginTop: 12, | ||
flexDirection: 'row', | ||
gap: 8, | ||
flexWrap: 'wrap', | ||
alignContent: 'center', | ||
justifyContent: 'flex-start' | ||
}}> | ||
<HasIconBadge hasBadge name='star-fill' color='#E2B340' count={repository.stargazerCount} /> | ||
<HasIconBadge hasBadge name='git-branch' count={repository.forkCount} /> | ||
<LanguageBadge {...repository.primaryLanguage} /> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { View } from "react-native" | ||
import RepositoryBadge from "./RepositoryBadge" | ||
import HasIconBadge from "./HasIconBadge" | ||
import { User } from "../../types/response" | ||
|
||
type Prop = { | ||
user: User | ||
} | ||
|
||
export default ({ user }: Prop) => { | ||
return ( | ||
<View style={{ marginTop: 12, flexDirection: 'row', gap: 8, flexWrap: 'wrap', alignContent: 'center', justifyContent: 'flex-start' }}> | ||
<RepositoryBadge count={user.repositories?.totalCount ?? 0} /> | ||
<HasIconBadge count={user.followers?.totalCount} name='people' hasBadge /> | ||
<HasIconBadge hasBadge={user.isDeveloperProgramMember} name="cpu" /> | ||
<HasIconBadge hasBadge={user.isGitHubStar} name="star-fill" /> | ||
<HasIconBadge hasBadge={user.hasSponsorsListing} name="code-of-conduct" /> | ||
</View> | ||
) | ||
} |