-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release React Native demo application (#104)
- Loading branch information
Spencer Lepine
authored
Mar 31, 2023
1 parent
a5c7934
commit 8efb93c
Showing
41 changed files
with
14,700 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: React Native Chat CI | ||
# - Install, lint, test, and build production Expo application | ||
# - Runs only on changes to connectReactNativeChat/ folder | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ master ] | ||
paths: 'connectReactNativeChat/**' | ||
pull_request: | ||
branches: [ master ] | ||
paths: 'connectReactNativeChat/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-12 | ||
strategy: | ||
matrix: | ||
node-version: [16.x] # 18.x, 19.x | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
defaults: | ||
run: | ||
working-directory: ./connectReactNativeChat | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Expo app dependencies | ||
run: yarn | ||
|
||
- run: yarn lint | ||
|
||
- name: Create endpoint.js config | ||
run: | | ||
cp endpoints.sample.js endpoints.js || echo "no endpoint.sample.js found" | ||
- run: yarn test | ||
|
||
- name: Create app.json config | ||
run: | | ||
rm app.json || echo "no app.json found, creating new" | ||
cp app.prod.json app.json | ||
- name: Build the Expo application | ||
run: CI=1 npx expo prebuild --platform 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
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,41 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"extends": [ | ||
"plugin:react/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"rules": { | ||
"react/prop-types": "off", | ||
"global-require": 0 | ||
}, | ||
"ignorePatterns": [ | ||
"assets", | ||
"ios", | ||
"android" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"**/*.test.js", | ||
"**/*.test.jsx" | ||
], | ||
"env": { | ||
"jest": true | ||
} | ||
} | ||
] | ||
} |
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,23 @@ | ||
node_modules | ||
.expo/ | ||
dist/ | ||
npm-debug.* | ||
*.jks | ||
*.p8 | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# Temporary files created by Metro to check the health of the file watcher | ||
.metro-health-check* | ||
|
||
endpoints.js | ||
yarn-error.log | ||
.dev | ||
android | ||
ios |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120 | ||
} |
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,67 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: MIT-0 | ||
|
||
import React from "react"; | ||
import { View, Image } from "react-native"; | ||
import { createStackNavigator } from "@react-navigation/stack"; | ||
import { NavigationContainer } from "@react-navigation/native"; | ||
|
||
import ChatWrapper from "./src/components/ChatWrapper"; | ||
import GiftedChatWidget from "./src/components/ChatWidget"; | ||
import DebuggerWidget from "./src/components/DebuggerWidget"; | ||
import ChatForm from "./src/components/ChatForm"; | ||
|
||
import { LogBox } from "react-native"; | ||
import { ENABLE_REACTNATIVE_LOGBOX } from "./config"; | ||
if (!ENABLE_REACTNATIVE_LOGBOX) { | ||
LogBox.ignoreAllLogs(); | ||
} | ||
|
||
const ChatScreen = ({ navigation }) => { | ||
return ( | ||
<ChatWrapper | ||
navigation={navigation} | ||
ChatWidgetComponent={GiftedChatWidget} | ||
/> | ||
); | ||
}; | ||
|
||
const HomeScreen = ({ navigation }) => ( | ||
<View | ||
style={{ | ||
flex: 1, | ||
alignItems: "center", | ||
padding: 10, | ||
marginTop: 100, | ||
}} | ||
> | ||
<Image | ||
source={require("./assets/connect.png")} | ||
style={{ | ||
height: 90, | ||
width: 100, | ||
padding: 10, | ||
}} | ||
alt="Connect logo" | ||
/> | ||
|
||
<ChatForm openChatScreen={() => navigation.navigate("Chat")} /> | ||
|
||
<DebuggerWidget /> | ||
</View> | ||
); | ||
|
||
const Stack = createStackNavigator(); | ||
|
||
const App = () => { | ||
return ( | ||
<NavigationContainer> | ||
<Stack.Navigator initialRouteName="Home"> | ||
<Stack.Screen name="Home" component={HomeScreen} /> | ||
<Stack.Screen name="Chat" component={ChatScreen} /> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
}; | ||
|
||
export default App; |
Oops, something went wrong.