This file contains hidden or 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
| function App() { | |
| const [eventData, setEventData] = useState([]); | |
| const [loading, setLoading] = useState(false); | |
| useEffect(() => { | |
| const fetchEvents = async() => { | |
| setLoading(true); | |
| const res = await fetch('https://eonet.sci.gsfc.nasa.gov/api/v2.1/events'); | |
| const { events } = await res.json(); |
This file contains hidden or 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
| ExecuteQuery = (sql, params = []) => new Promise((resolve, reject) => { | |
| db.transaction((trans) => { | |
| trans.executeSql(sql, params, (trans, results) => { | |
| resolve(results); | |
| }, | |
| (error) => { | |
| reject(error); | |
| }); | |
| }); | |
| }); |
This file contains hidden or 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
| import React from 'react'; | |
| import { View, LogBox, Text, StyleSheet, SafeAreaView, FlatList, RefreshControl, TouchableOpacity } from 'react-native'; | |
| import { Chip } from 'react-native-paper'; | |
| import { openDatabase } from 'react-native-sqlite-storage'; | |
| import renderSubCategory from '../components/renderSubCategory'; | |
| const db = openDatabase({ name: 'SQLite.db', location: 'default', createFromLocation: '~SQLite.db' }); | |
| // Disable FlatList Render Warning for categories display |
This file contains hidden or 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
| import React from 'react'; | |
| import { View, Text, StyleSheet, SafeAreaView, TouchableOpacity } from 'react-native'; | |
| import { TextInput } from 'react-native-paper'; | |
| import SearchableDropdown from 'react-native-searchable-dropdown'; | |
| import { openDatabase } from 'react-native-sqlite-storage'; | |
| const db = openDatabase({ name: 'SQLite.db', location: 'default', createFromLocation: '~SQLite.db' }); | |
| export default class AddCategoryScreen extends React.Component { |
This file contains hidden or 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
| import React, {useState, useEffect} from 'react'; | |
| import { | |
| ActivityIndicator, | |
| View, | |
| StyleSheet, | |
| Image | |
| } from 'react-native'; | |
| import AsyncStorage from '@react-native-async-storage/async-storage'; |
This file contains hidden or 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
| import React, { Component } from "react"; | |
| import { | |
| StyleSheet, | |
| Text, | |
| TouchableOpacity, | |
| ScrollView, | |
| View, | |
| Image | |
| } from "react-native"; |
This file contains hidden or 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
| import 'react-native-gesture-handler'; | |
| import React from 'react'; | |
| import { NavigationContainer } from '@react-navigation/native'; | |
| import { createStackNavigator } from '@react-navigation/stack'; | |
| import SplashScreen from './src/screens/SplashScreen'; | |
| import LoginScreen from './src/screens/LoginScreen'; | |
| import RegisterScreen from './src/screens/RegisterScreen'; |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { | |
| StyleSheet, | |
| View, | |
| Text, | |
| ScrollView, | |
| TouchableOpacity, | |
| SafeAreaView, | |
| KeyboardAvoidingView, | |
| } from 'react-native'; |
This file contains hidden or 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
| const express = require('express'); | |
| const router = express.Router(); | |
| const Post = require('../models/Post'); | |
| // Create A post for specific user - Create | |
| router.post('/:uid', async (req, res) => { | |
| const post = new Post({ | |
| userID: req.params.uid, | |
| title: req.body.title, |
This file contains hidden or 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
| const express = require('express'); | |
| const bcrypt = require('bcryptjs'); | |
| const jwt = require('jsonwebtoken'); | |
| const router = express.Router(); | |
| // MongoDB Model | |
| const User = require('../models/User'); | |
| const Post = require('../models/Post'); | |
| // VALIDATION Import |