Skip to content

Commit 498b4e3

Browse files
WoLewickitomekzawNaturalclarj-piasecki
authored
feat: add Fabric support (#456)
Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com> Co-authored-by: Jesse Katsumata <niconico.clarinet@gmail.com> Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com> Co-authored-by: Jakub Piasecki <jakubpiasecki67@gmail.com>
1 parent 64d7e19 commit 498b4e3

File tree

107 files changed

+13223
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+13223
-256
lines changed

FabricExample/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

FabricExample/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

FabricExample/.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
node_modules/
40+
npm-debug.log
41+
yarn-error.log
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://docs.fastlane.tools/best-practices/source-control/
49+
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ruby / CocoaPods
59+
/ios/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage

FabricExample/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

FabricExample/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

FabricExample/App.tsx

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import * as React from 'react';
2+
import {
3+
Platform,
4+
ScrollView,
5+
StyleSheet,
6+
Text,
7+
View,
8+
SafeAreaView,
9+
I18nManager,
10+
Switch,
11+
} from 'react-native';
12+
13+
import * as PickerExamples from './PickerExample';
14+
import * as PickerIOSExamples from './PickerIOSExample';
15+
16+
export default function App() {
17+
const [isRTL, setIsRTL] = React.useState(I18nManager.isRTL);
18+
React.useEffect(() => {
19+
I18nManager.allowRTL(true);
20+
}, []);
21+
22+
return (
23+
<SafeAreaView style={styles.main}>
24+
<ScrollView>
25+
<View style={styles.rtlSwitchContainer}>
26+
<Switch
27+
value={isRTL}
28+
onValueChange={(newValue) => {
29+
setIsRTL(newValue);
30+
I18nManager.forceRTL(newValue);
31+
}}
32+
/>
33+
<Text>{I18nManager.isRTL ? 'RTL' : 'LTR'}</Text>
34+
</View>
35+
<View style={styles.container}>
36+
<Text style={styles.heading}>Picker Examples</Text>
37+
{PickerExamples.examples.map((element) => (
38+
<View style={styles.elementContainer} key={element.title}>
39+
<Text style={styles.title}> {element.title} </Text>
40+
{element.render()}
41+
</View>
42+
))}
43+
{Platform.OS === 'ios' && (
44+
<Text style={styles.heading}>PickerIOS Examples</Text>
45+
)}
46+
{Platform.OS === 'ios' &&
47+
PickerIOSExamples.examples.map((element) => (
48+
<View style={styles.elementContainer} key={element.title}>
49+
<Text style={styles.title}> {element.title} </Text>
50+
{element.render()}
51+
</View>
52+
))}
53+
{Platform.OS === 'windows' && (
54+
<Text style={styles.heading}>PickerWindows Examples</Text>
55+
)}
56+
</View>
57+
</ScrollView>
58+
</SafeAreaView>
59+
);
60+
}
61+
62+
const styles = StyleSheet.create({
63+
main: {
64+
backgroundColor: '#F5FCFF',
65+
},
66+
container: {
67+
padding: 24,
68+
paddingBottom: 60,
69+
},
70+
title: {
71+
fontSize: 18,
72+
},
73+
elementContainer: {
74+
marginTop: 8,
75+
},
76+
heading: {
77+
fontSize: 22,
78+
color: 'black',
79+
},
80+
rtlSwitchContainer: {
81+
flexDirection: 'row',
82+
justifyContent: 'space-between',
83+
paddingHorizontal: 40,
84+
paddingTop: 20,
85+
},
86+
});

FabricExample/Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
gem 'cocoapods', '~> 1.13'
7+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

FabricExample/Gemfile.lock

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.6)
5+
rexml
6+
activesupport (7.0.8)
7+
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
i18n (>= 1.6, < 2)
9+
minitest (>= 5.1)
10+
tzinfo (~> 2.0)
11+
addressable (2.8.5)
12+
public_suffix (>= 2.0.2, < 6.0)
13+
algoliasearch (1.27.5)
14+
httpclient (~> 2.8, >= 2.8.3)
15+
json (>= 1.5.1)
16+
atomos (0.1.3)
17+
claide (1.1.0)
18+
cocoapods (1.14.3)
19+
addressable (~> 2.8)
20+
claide (>= 1.0.2, < 2.0)
21+
cocoapods-core (= 1.14.3)
22+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23+
cocoapods-downloader (>= 2.1, < 3.0)
24+
cocoapods-plugins (>= 1.0.0, < 2.0)
25+
cocoapods-search (>= 1.0.0, < 2.0)
26+
cocoapods-trunk (>= 1.6.0, < 2.0)
27+
cocoapods-try (>= 1.1.0, < 2.0)
28+
colored2 (~> 3.1)
29+
escape (~> 0.0.4)
30+
fourflusher (>= 2.3.0, < 3.0)
31+
gh_inspector (~> 1.0)
32+
molinillo (~> 0.8.0)
33+
nap (~> 1.0)
34+
ruby-macho (>= 2.3.0, < 3.0)
35+
xcodeproj (>= 1.23.0, < 2.0)
36+
cocoapods-core (1.14.3)
37+
activesupport (>= 5.0, < 8)
38+
addressable (~> 2.8)
39+
algoliasearch (~> 1.0)
40+
concurrent-ruby (~> 1.1)
41+
fuzzy_match (~> 2.0.4)
42+
nap (~> 1.0)
43+
netrc (~> 0.11)
44+
public_suffix (~> 4.0)
45+
typhoeus (~> 1.0)
46+
cocoapods-deintegrate (1.0.5)
47+
cocoapods-downloader (2.1)
48+
cocoapods-plugins (1.0.0)
49+
nap
50+
cocoapods-search (1.0.1)
51+
cocoapods-trunk (1.6.0)
52+
nap (>= 0.8, < 2.0)
53+
netrc (~> 0.11)
54+
cocoapods-try (1.2.0)
55+
colored2 (3.1.2)
56+
concurrent-ruby (1.2.2)
57+
escape (0.0.4)
58+
ethon (0.16.0)
59+
ffi (>= 1.15.0)
60+
ffi (1.16.3)
61+
fourflusher (2.3.1)
62+
fuzzy_match (2.0.4)
63+
gh_inspector (1.1.3)
64+
httpclient (2.8.3)
65+
i18n (1.14.1)
66+
concurrent-ruby (~> 1.0)
67+
json (2.6.3)
68+
minitest (5.20.0)
69+
molinillo (0.8.0)
70+
nanaimo (0.3.0)
71+
nap (1.1.0)
72+
netrc (0.11.0)
73+
public_suffix (4.0.7)
74+
rexml (3.2.6)
75+
ruby-macho (2.5.1)
76+
typhoeus (1.4.1)
77+
ethon (>= 0.9.0)
78+
tzinfo (2.0.6)
79+
concurrent-ruby (~> 1.0)
80+
xcodeproj (1.23.0)
81+
CFPropertyList (>= 2.3.3, < 4.0)
82+
atomos (~> 0.1.3)
83+
claide (>= 1.0.2, < 2.0)
84+
colored2 (~> 3.1)
85+
nanaimo (~> 0.3.0)
86+
rexml (~> 3.2.4)
87+
88+
PLATFORMS
89+
ruby
90+
91+
DEPENDENCIES
92+
activesupport (>= 6.1.7.3, < 7.1.0)
93+
cocoapods (~> 1.13)
94+
95+
RUBY VERSION
96+
ruby 2.7.5p203
97+
98+
BUNDLED WITH
99+
2.1.4

0 commit comments

Comments
 (0)