Skip to content

Commit

Permalink
chore: add more example projects (#686)
Browse files Browse the repository at this point in the history
* chore: add more example projects

* add more examples
  • Loading branch information
henninghall authored Sep 6, 2023
1 parent a3b82ad commit f0bee76
Show file tree
Hide file tree
Showing 128 changed files with 20,662 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/Rn069/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ PODS:
- React-jsinspector (0.69.0)
- React-logger (0.69.0):
- glog
- react-native-date-picker (4.2.6):
- react-native-date-picker (4.2.13):
- React-Core
- React-perflogger (0.69.0)
- React-RCTActionSheet (0.69.0):
Expand Down Expand Up @@ -527,15 +527,15 @@ SPEC CHECKSUMS:
React: 8a8fc19196a41141ecb5bde33c97091cdc25ccd8
React-bridging: 543858c1fc01ed8264585c5a2646305d20225840
React-callinvoker: cc62aa541f261cee6f990f870dbf6aff38f97eef
React-Codegen: a80f7ec979174e44dcaecc9d5639ac84a7077a71
React-Codegen: b3a302c8f6216332fe9d64be3f6eba00154a0c41
React-Core: 7faa8679c6f38b5462a71d55b399483f46365e44
React-CoreModules: 3a51e8d50928a8593ea44606c00ffa60db95222f
React-cxxreact: 51a2239091bc13a3c0b5b1cb445b1585a483df2d
React-jsi: 80aef7359ddaacd86f7247fec6a8dff4db099dc6
React-jsiexecutor: b2a049b9f156342f6037ccb0c8acf69f923d3089
React-jsinspector: 6aced68014b275b7abd073c9598b0affd0e1669c
React-logger: bcf33ce10afa135158c72635e621ddb94126c610
react-native-date-picker: 93e43b3084cea595b4d68b1405d6d99849663bd6
react-native-date-picker: 04e866ba4e7857f83abd504ad42e787f0f02ae00
React-perflogger: aa48956d87bae67fc847acc196fae97928b96cd3
React-RCTActionSheet: 4eaab2b885130ce9a88c8fdac5f1992315da80f6
React-RCTAnimation: 5e91e3ceb988838fa43615bb602181be30d2b26e
Expand Down
2 changes: 2 additions & 0 deletions examples/Rn071/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
4 changes: 4 additions & 0 deletions examples/Rn071/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
63 changes: 63 additions & 0 deletions examples/Rn071/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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
ios/.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
/ios/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
1 change: 1 addition & 0 deletions examples/Rn071/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
7 changes: 7 additions & 0 deletions examples/Rn071/.prettierrc.js
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',
};
1 change: 1 addition & 0 deletions examples/Rn071/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
131 changes: 131 additions & 0 deletions examples/Rn071/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/

import type {PropsWithChildren} from 'react';
import React, {useState} from 'react';
import {
Button,
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';

import DatePicker from 'react-native-date-picker';
import {
Colors,
Header,
LearnMoreLinks,
} from 'react-native/Libraries/NewAppScreen';

type SectionProps = PropsWithChildren<{
title: string;
}>;

function Section({children, title}: SectionProps): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
const [date, setDate] = useState(new Date());
const [open, setOpen] = useState(false);
return (
<View style={styles.sectionContainer} key={title}>
<Button title="open" onPress={() => setOpen(true)} />
<DatePicker
date={new Date('2021-01-01T2:00:00Z')}
modal
mode="date"
onConfirm={date => {
setDate(date);
setOpen(false);
}}
onCancel={() => {
setOpen(false);
}}
open={open}
/>
<DatePicker
date={date}
maximumDate={new Date('2000-02-01')}
minimumDate={new Date('2000-01-01')}
onDateChange={setDate}
androidVariant="nativeAndroid"
/>
<Text
style={[
styles.sectionTitle,
{
color: isDarkMode ? Colors.white : Colors.black,
},
]}>
{date.toISOString()}
</Text>
<Text
style={[
styles.sectionDescription,
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}>
{children}
</Text>
</View>
);
}

function App(): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';

const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};

return (
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
<Header />
<View
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Section title="Learn More">
Read the docs to discover what to do next:
</Section>
<LearnMoreLinks />
</View>
</ScrollView>
</SafeAreaView>
);
}

const styles = StyleSheet.create({
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
},
highlight: {
fontWeight: '700',
},
});

export default App;
6 changes: 6 additions & 0 deletions examples/Rn071/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'

gem 'cocoapods', '>= 1.11.3'
98 changes: 98 additions & 0 deletions examples/Rn071/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.0.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.12.1)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.12.1)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.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.21.0, < 2.0)
cocoapods-core (1.12.1)
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 (1.6.3)
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.2.2)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.19.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.22.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.2.4)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (>= 1.11.3)

RUBY VERSION
ruby 3.2.2p53

BUNDLED WITH
2.4.10
14 changes: 14 additions & 0 deletions examples/Rn071/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
Loading

0 comments on commit f0bee76

Please sign in to comment.