-
Notifications
You must be signed in to change notification settings - Fork 26
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
b6750f9
commit 6daab3f
Showing
64 changed files
with
4,204 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit $1 |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/src | ||
lib/**/*.map | ||
/example | ||
/BareExample |
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,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
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,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native', | ||
}; |
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,74 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
**/.xcode.env.local | ||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
*.hprof | ||
.cxx/ | ||
*.keystore | ||
!debug.keystore | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# fastlane | ||
# | ||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
# screenshots whenever they are needed. | ||
# For more information about the recommended setup visit: | ||
# https://docs.fastlane.tools/best-practices/source-control/ | ||
|
||
**/fastlane/report.xml | ||
**/fastlane/Preview.html | ||
**/fastlane/screenshots | ||
**/fastlane/test_output | ||
|
||
# Bundle artifact | ||
*.jsbundle | ||
|
||
# Ruby / CocoaPods | ||
**/Pods/ | ||
/vendor/bundle/ | ||
|
||
# Temporary files created by Metro to check the health of the file watcher | ||
.metro-health-check* | ||
|
||
# testing | ||
/coverage | ||
|
||
# Yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
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,7 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSameLine: true, | ||
bracketSpacing: false, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}; |
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 @@ | ||
{} |
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,148 @@ | ||
/* eslint-disable react-native/no-inline-styles */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { | ||
StyleSheet, | ||
View, | ||
Text, | ||
SafeAreaView, | ||
FlatList, | ||
StatusBar, | ||
Image, | ||
TouchableOpacity, | ||
} from 'react-native'; | ||
import * as IconPack from 'phosphor-react-native'; | ||
import PhosphorLogo from './phosphor-mark-tight-yellow.png'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const { IconContext, ...Icons } = IconPack; | ||
|
||
const weights = ['thin', 'light', 'regular', 'bold', 'fill', 'duotone']; | ||
|
||
export default function App() { | ||
const [weightIdx, setWeightIdx] = React.useState(2); | ||
const [mirrorActive, setMirrorActive] = React.useState(false); | ||
|
||
const weight: IconPack.IconWeight = React.useMemo( | ||
() => weights[weightIdx] as any, | ||
[weightIdx] | ||
); | ||
|
||
const handleChangeWeight = React.useCallback(() => { | ||
setWeightIdx((weightIdx + 1) % weights.length); | ||
}, [weightIdx]); | ||
|
||
const handleToggleMirror = React.useCallback(() => { | ||
setMirrorActive(!mirrorActive); | ||
}, [mirrorActive]); | ||
|
||
return ( | ||
<View style={styles.rootView}> | ||
<StatusBar barStyle="light-content" /> | ||
|
||
<SafeAreaView style={styles.headerContainer}> | ||
<View style={styles.header}> | ||
<Image source={PhosphorLogo} style={styles.logoImage} /> | ||
<View | ||
style={{ | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
<Text style={styles.headerText}>Phosphor React Native</Text> | ||
<Text | ||
style={{ | ||
color: '#fff', | ||
opacity: 0.8, | ||
textTransform: 'capitalize', | ||
}} | ||
> | ||
{weight} | ||
</Text> | ||
</View> | ||
<TouchableOpacity | ||
style={styles.weightSelect} | ||
onPress={handleChangeWeight} | ||
> | ||
<IconPack.PencilLine color="#FFF" weight={weight} /> | ||
</TouchableOpacity> | ||
<TouchableOpacity | ||
style={styles.weightSelect} | ||
onPress={handleToggleMirror} | ||
> | ||
<IconPack.Swap color="#FFF" weight={weight} /> | ||
</TouchableOpacity> | ||
</View> | ||
</SafeAreaView> | ||
<FlatList | ||
style={styles.scrollView} | ||
contentContainerStyle={styles.main} | ||
data={Object.entries(Icons).filter(([, Icon]) => !!Icon) as any[]} | ||
keyExtractor={(item) => item[0]} | ||
numColumns={3} | ||
renderItem={({ item: [name, Icon] }) => ( | ||
<View style={styles.iconItem}> | ||
<Icon size={48} weight={weight} mirrored={mirrorActive} /> | ||
<Text style={styles.iconName}>{name}</Text> | ||
</View> | ||
)} | ||
/> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
rootView: { | ||
flex: 1, | ||
backgroundColor: '#FFF', | ||
}, | ||
headerContainer: { | ||
backgroundColor: '#e76f51', | ||
}, | ||
header: { | ||
backgroundColor: '#e76f51', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
flexDirection: 'row', | ||
paddingBottom: 16, | ||
paddingHorizontal: 16, | ||
}, | ||
logoImage: { | ||
width: 40, | ||
height: 40, | ||
borderRadius: 20, | ||
}, | ||
headerText: { | ||
color: '#FFF', | ||
fontSize: 18, | ||
fontWeight: 'bold', | ||
flex: 1, | ||
textAlign: 'center', | ||
}, | ||
weightSelect: { | ||
width: 40, | ||
}, | ||
scrollView: { | ||
flex: 1, | ||
}, | ||
main: { | ||
backgroundColor: 'white', | ||
paddingHorizontal: 8, | ||
paddingBottom: 16, | ||
}, | ||
iconItem: { | ||
width: '33%', | ||
height: 100, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
padding: 8, | ||
}, | ||
iconName: { | ||
textAlign: 'center', | ||
opacity: 0.8, | ||
marginTop: 4, | ||
}, | ||
}); |
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,8 @@ | ||
source 'https://rubygems.org' | ||
|
||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby ">= 2.6.10" | ||
|
||
# Exclude problematic versions of cocoapods and activesupport that causes build failures. | ||
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' | ||
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' |
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,105 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (3.0.7) | ||
base64 | ||
nkf | ||
rexml | ||
activesupport (6.1.7.8) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (>= 1.6, < 2) | ||
minitest (>= 5.1) | ||
tzinfo (~> 2.0) | ||
zeitwerk (~> 2.3) | ||
addressable (2.8.7) | ||
public_suffix (>= 2.0.2, < 7.0) | ||
algoliasearch (1.27.5) | ||
httpclient (~> 2.8, >= 2.8.3) | ||
json (>= 1.5.1) | ||
atomos (0.1.3) | ||
base64 (0.2.0) | ||
claide (1.1.0) | ||
cocoapods (1.15.2) | ||
addressable (~> 2.8) | ||
claide (>= 1.0.2, < 2.0) | ||
cocoapods-core (= 1.15.2) | ||
cocoapods-deintegrate (>= 1.0.3, < 2.0) | ||
cocoapods-downloader (>= 2.1, < 3.0) | ||
cocoapods-plugins (>= 1.0.0, < 2.0) | ||
cocoapods-search (>= 1.0.0, < 2.0) | ||
cocoapods-trunk (>= 1.6.0, < 2.0) | ||
cocoapods-try (>= 1.1.0, < 2.0) | ||
colored2 (~> 3.1) | ||
escape (~> 0.0.4) | ||
fourflusher (>= 2.3.0, < 3.0) | ||
gh_inspector (~> 1.0) | ||
molinillo (~> 0.8.0) | ||
nap (~> 1.0) | ||
ruby-macho (>= 2.3.0, < 3.0) | ||
xcodeproj (>= 1.23.0, < 2.0) | ||
cocoapods-core (1.15.2) | ||
activesupport (>= 5.0, < 8) | ||
addressable (~> 2.8) | ||
algoliasearch (~> 1.0) | ||
concurrent-ruby (~> 1.1) | ||
fuzzy_match (~> 2.0.4) | ||
nap (~> 1.0) | ||
netrc (~> 0.11) | ||
public_suffix (~> 4.0) | ||
typhoeus (~> 1.0) | ||
cocoapods-deintegrate (1.0.5) | ||
cocoapods-downloader (2.1) | ||
cocoapods-plugins (1.0.0) | ||
nap | ||
cocoapods-search (1.0.1) | ||
cocoapods-trunk (1.6.0) | ||
nap (>= 0.8, < 2.0) | ||
netrc (~> 0.11) | ||
cocoapods-try (1.2.0) | ||
colored2 (3.1.2) | ||
concurrent-ruby (1.3.4) | ||
escape (0.0.4) | ||
ethon (0.16.0) | ||
ffi (>= 1.15.0) | ||
ffi (1.17.0) | ||
fourflusher (2.3.1) | ||
fuzzy_match (2.0.4) | ||
gh_inspector (1.1.3) | ||
httpclient (2.8.3) | ||
i18n (1.14.6) | ||
concurrent-ruby (~> 1.0) | ||
json (2.7.2) | ||
minitest (5.25.1) | ||
molinillo (0.8.0) | ||
nanaimo (0.3.0) | ||
nap (1.1.0) | ||
netrc (0.11.0) | ||
nkf (0.2.0) | ||
public_suffix (4.0.7) | ||
rexml (3.3.7) | ||
ruby-macho (2.5.1) | ||
typhoeus (1.4.1) | ||
ethon (>= 0.9.0) | ||
tzinfo (2.0.6) | ||
concurrent-ruby (~> 1.0) | ||
xcodeproj (1.25.0) | ||
CFPropertyList (>= 2.3.3, < 4.0) | ||
atomos (~> 0.1.3) | ||
claide (>= 1.0.2, < 2.0) | ||
colored2 (~> 3.1) | ||
nanaimo (~> 0.3.0) | ||
rexml (>= 3.3.2, < 4.0) | ||
zeitwerk (2.6.18) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
activesupport (>= 6.1.7.5, != 7.1.0) | ||
cocoapods (>= 1.13, != 1.15.1, != 1.15.0) | ||
|
||
RUBY VERSION | ||
ruby 2.6.10p210 | ||
|
||
BUNDLED WITH | ||
1.17.2 |
Oops, something went wrong.