├── .env.example ├── __mocks__ └── axios.js ├── tsconfig.json ├── assets ├── icon.png ├── splash.png ├── favicon.png ├── adaptive-icon.png └── context.ts ├── .husky └── commit-msg ├── __tests__ ├── smoke.spec.ts └── app.js ├── babel.config.js ├── commitlint.config.js ├── app ├── utils │ └── newId.ts ├── store │ ├── rootSaga.ts │ └── index.ts ├── screens │ ├── Main.tsx │ └── ErrorScreen │ │ ├── ErrorDetails.tsx │ │ └── ErrorBoundary.tsx ├── features │ └── messages │ │ ├── messagesHelpers.ts │ │ ├── __tests__ │ │ └── MessagesSagas.ts │ │ ├── messagesSagas.ts │ │ ├── messagesSlice.ts │ │ └── MessagesComponent.tsx └── services │ └── api.ts ├── .gitignore ├── .eslintrc.js ├── App.js ├── release.config.js ├── .github └── workflows │ ├── staging.yml │ └── production.yml ├── LICENSE ├── app.config.js ├── package.json ├── README.md └── CHANGELOG.md /.env.example: -------------------------------------------------------------------------------- 1 | HUGGINGFACE_KEY="xxxx" -------------------------------------------------------------------------------- /__mocks__/axios.js: -------------------------------------------------------------------------------- 1 | import mockAxios from 'jest-mock-axios'; 2 | export default mockAxios; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": {}, 3 | "extends": "expo/tsconfig.base" 4 | } 5 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtvandusen/React-Native-Easy-Chatbot/HEAD/assets/icon.png -------------------------------------------------------------------------------- /assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtvandusen/React-Native-Easy-Chatbot/HEAD/assets/splash.png -------------------------------------------------------------------------------- /assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtvandusen/React-Native-Easy-Chatbot/HEAD/assets/favicon.png -------------------------------------------------------------------------------- /assets/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kurtvandusen/React-Native-Easy-Chatbot/HEAD/assets/adaptive-icon.png -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit "$1" 5 | -------------------------------------------------------------------------------- /__tests__/smoke.spec.ts: -------------------------------------------------------------------------------- 1 | describe('truth', () => { 2 | it('is true', () => { 3 | expect(true).toEqual(true); 4 | }); 5 | }); -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (api) { 2 | api.cache(true); 3 | return { 4 | presets: ["babel-preset-expo"], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@commitlint/config-conventional"], 3 | ignores: [(message) => message.includes("https://")], 4 | }; 5 | -------------------------------------------------------------------------------- /app/utils/newId.ts: -------------------------------------------------------------------------------- 1 | let lastId: number = 0; 2 | 3 | export const newId = (prefix: string = "id") => { 4 | lastId++; 5 | const newId: string = `${prefix}${lastId}`; 6 | return newId; 7 | }; 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | 13 | # macOS 14 | .DS_Store 15 | 16 | .env -------------------------------------------------------------------------------- /app/store/rootSaga.ts: -------------------------------------------------------------------------------- 1 | import { all } from "redux-saga/effects"; 2 | 3 | import { messagesSaga } from "../features/messages/messagesSagas"; 4 | 5 | export default function* rootSaga() { 6 | yield all([messagesSaga()]); 7 | } 8 | -------------------------------------------------------------------------------- /__tests__/app.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import renderer from 'react-test-renderer'; 3 | 4 | import App from '../App'; 5 | 6 | describe('', () => { 7 | it('has 1 child', () => { 8 | const tree = renderer.create().toJSON(); 9 | expect(tree.children.length).toBe(1); 10 | }); 11 | }); -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["universe/native", "universe/shared/typescript-analysis"], 3 | 4 | overrides: [ 5 | { 6 | files: ["*.ts", "*.tsx", "*.d.ts"], 7 | 8 | parserOptions: { 9 | project: "./tsconfig.json", 10 | }, 11 | }, 12 | ], 13 | 14 | env: { 15 | node: true, 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import { Provider } from "react-redux"; 2 | 3 | import { ErrorBoundary } from "./app/screens/ErrorScreen/ErrorBoundary"; 4 | import Main from "./app/screens/Main"; 5 | import { store } from "./app/store"; 6 | 7 | export default function App() { 8 | return ( 9 | 10 | 11 |
12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /app/screens/Main.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { StyleSheet, SafeAreaView } from "react-native"; 3 | 4 | import MessagesComponent from "../features/messages/MessagesComponent"; 5 | 6 | export default function Main() { 7 | return ( 8 | 9 | 10 | 11 | ); 12 | } 13 | 14 | const styles = StyleSheet.create({ 15 | container: { 16 | flex: 1, 17 | }, 18 | textInputStyle: { 19 | backgroundColor: "#FFFFF0", 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /app/screens/ErrorScreen/ErrorDetails.tsx: -------------------------------------------------------------------------------- 1 | import React, { ErrorInfo } from "react"; 2 | import { ScrollView, View, Text, Button } from "react-native"; 3 | 4 | export interface ErrorDetailsProps { 5 | error: Error; 6 | errorInfo: ErrorInfo; 7 | onReset(): void; 8 | } 9 | 10 | export function ErrorDetails(props: ErrorDetailsProps) { 11 | return ( 12 | 13 | 14 | {`${props.error}`.trim()} 15 | {`${props.errorInfo.componentStack}`.trim()} 16 | 17 | 18 |