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 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 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
| 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
| 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
| const API_KEY = 'YOUR_API_KEY'; | |
| const Map = ({ eventData, center, zoom }) => { | |
| const [locationInfo, setLocationInfo] = useState(null); | |
| const markers = eventData.map(ev => { | |
| if(ev.categories[0].id === 8) { | |
| return <LocationMarker | |
| lat={ev.geometries[0].coordinates[1]} |
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 { Icon } from '@iconify/react'; | |
| import locationIcon from '@iconify/icons-mdi/fire-alert'; | |
| const LocationMarker = ({ lat, lng, onClick }) => { | |
| return ( | |
| <div className="location-marker" onClick={onClick}> | |
| <Icon icon={locationIcon} className="location-icon" /> | |
| </div> | |
| ) | |
| } |
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
| android { | |
| .... | |
| signingConfigs { | |
| release { | |
| storeFile file('your_key_name.keystore') | |
| storePassword 'your_key_store_password' | |
| keyAlias 'your_key_alias' | |
| keyPassword 'your_key_file_alias_password' | |
| } | |
| } |
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
| signingConfigs { | |
| release { | |
| storeFile file('your_key_name.keystore') | |
| storePassword System.console().readLine("\nKeystore password:") | |
| keyAlias System.console().readLine("\nAlias: ") | |
| keyPassword System.console().readLine("\nAlias password: ") | |
| } | |
| } |
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
| react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle | |
| --assets-dest android/app/src/main/res/ |