├── .expo-shared └── assets.json ├── .gitignore ├── App.js ├── app.json ├── assets ├── favicon.png ├── icon.png └── splash.png ├── babel.config.js ├── package-lock.json ├── package.json ├── src ├── CreateNoteComponent.js ├── LoginScreenComponent.js ├── NotesScreenComponent.js └── SingleNoteSummaryComponent.js └── yarn.lock /.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | *.jks 5 | *.p8 6 | *.p12 7 | *.key 8 | *.mobileprovision 9 | *.orig.* 10 | web-build/ 11 | 12 | # macOS 13 | .DS_Store 14 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import { StatusBar } from 'expo-status-bar'; 2 | import React, { useState } from 'react'; 3 | import { StyleSheet, Text, View } from 'react-native'; 4 | import NotesScreenComponent from './src/NotesScreenComponent'; 5 | import firebase from 'firebase'; 6 | import LoginScreenComponent from './src/LoginScreenComponent'; 7 | 8 | export default function App() { 9 | const [userLoggedIn, setUserLoggedIn] = useState(false) 10 | 11 | if(firebase.apps.length === 0){ 12 | var firebaseConfig = { 13 | apiKey: "AIzaSyBkAskm-vbTlinLz742uDzLA7bAczCMPes", 14 | authDomain: "rn-masterclass-d5.firebaseapp.com", 15 | databaseURL: "https://rn-masterclass-d5.firebaseio.com", 16 | projectId: "rn-masterclass-d5", 17 | storageBucket: "rn-masterclass-d5.appspot.com", 18 | messagingSenderId: "986531550204", 19 | appId: "1:986531550204:web:24c9dfb7410fda01471879" 20 | }; 21 | // Initialize Firebase 22 | firebase.initializeApp(firebaseConfig); 23 | } 24 | 25 | firebase.auth().onAuthStateChanged((user) => { 26 | if(user === null) { 27 | setUserLoggedIn(false) 28 | } else { 29 | setUserLoggedIn(true) 30 | } 31 | }) 32 | 33 | if(userLoggedIn) { 34 | return ( 35 | 36 | 37 | 38 | ); 39 | } else { 40 | return ( 41 | 42 | 43 | 44 | ); 45 | } 46 | 47 | 48 | return ( 49 | 50 | {/* */} 51 | 52 | 53 | ); 54 | } 55 | 56 | const styles = StyleSheet.create({ 57 | container: { 58 | flex: 1, 59 | backgroundColor: '#fff', 60 | alignItems: 'center', 61 | justifyContent: 'center', 62 | }, 63 | }); 64 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "todo-react-native", 4 | "slug": "todo-react-native", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "splash": { 9 | "image": "./assets/splash.png", 10 | "resizeMode": "contain", 11 | "backgroundColor": "#ffffff" 12 | }, 13 | "updates": { 14 | "fallbackToCacheTimeout": 0 15 | }, 16 | "assetBundlePatterns": [ 17 | "**/*" 18 | ], 19 | "ios": { 20 | "supportsTablet": true 21 | }, 22 | "web": { 23 | "favicon": "./assets/favicon.png" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scaleracademy/todo-react-native/1f6374925739e897c8416db977f9fed4a61315b3/assets/favicon.png -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scaleracademy/todo-react-native/1f6374925739e897c8416db977f9fed4a61315b3/assets/icon.png -------------------------------------------------------------------------------- /assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scaleracademy/todo-react-native/1f6374925739e897c8416db977f9fed4a61315b3/assets/splash.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "node_modules/expo/AppEntry.js", 3 | "scripts": { 4 | "start": "expo start", 5 | "android": "expo start --android", 6 | "ios": "expo start --ios", 7 | "web": "expo start --web", 8 | "eject": "expo eject" 9 | }, 10 | "dependencies": { 11 | "@react-native-community/masked-view": "0.1.10", 12 | "@react-navigation/native": "^5.7.2", 13 | "expo": "~38.0.8", 14 | "expo-status-bar": "^1.0.2", 15 | "firebase": "^7.17.1", 16 | "lodash": "^4.17.19", 17 | "react": "~16.11.0", 18 | "react-dom": "~16.11.0", 19 | "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz", 20 | "react-native-gesture-handler": "~1.6.0", 21 | "react-native-reanimated": "~1.9.0", 22 | "react-native-safe-area-context": "~3.0.7", 23 | "react-native-screens": "~2.9.0", 24 | "react-native-web": "~0.11.7" 25 | }, 26 | "devDependencies": { 27 | "@babel/core": "^7.8.6", 28 | "babel-preset-expo": "~8.1.0" 29 | }, 30 | "private": true 31 | } 32 | -------------------------------------------------------------------------------- /src/CreateNoteComponent.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {StyleSheet, TextInput, Button, View} from 'react-native' 3 | import firebase from 'firebase'; 4 | 5 | const CreateNoteComponent = (props) => { 6 | console.log(props) 7 | const [newNoteText, setNewNoteText] = useState('') 8 | 9 | return 10 | { 17 | setNewNoteText(currentText) 18 | 19 | } 20 | } 21 | /> 22 |