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 MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; | |
| import { NavigationContainer } from '@react-navigation/native'; | |
| import { createStackNavigator } from '@react-navigation/stack'; | |
| import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'; | |
| import HomeScreen from './src/pages/HomeScreen'; | |
| import DetailsScreen from './src/pages/DetailsScreen'; | |
| import ProfileScreen from './src/pages/ProfileScreen'; |
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, SafeAreaView, StatusBar, ScrollView, Image } from 'react-native'; | |
| import CardView from '../components/CardView'; | |
| class HomeScreen extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| navigation: props.navigation, | |
| isLoading: true, |
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 * as React from 'react'; | |
| import { View, Text, SafeAreaView, StatusBar, ImageBackground, ScrollView, Linking, StyleSheet } from 'react-native'; | |
| import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; | |
| const DetailsScreen = ({ route, navigation }) => { | |
| const item = route.params.newsData; | |
| // console.log(navigation) |
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, SafeAreaView, StatusBar, Button } from 'react-native'; | |
| import { Searchbar, Chip, Subheading } from 'react-native-paper'; | |
| import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; | |
| import DatePicker from 'react-native-datepicker'; | |
| import SearchListView from '../components/SearchListView'; | |
| class SearchScreen extends React.Component { | |
| constructor(props) { |
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 { FlatList, View, TouchableOpacity, ImageBackground, Text, StyleSheet, Dimensions, Linking } from 'react-native'; | |
| const windowHeight = Dimensions.get('window').height / 1.8; | |
| const windowWidth = Dimensions.get('window').width / 1.4; | |
| const CardView = ({ data, navigation }) => { | |
| const ItemView = ({ item }) => { | |
| var resTitle = item.title.substring(0, 50) + '. . .'; | |
| var resDesc = ''; |
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 { FlatList, View, TouchableOpacity, Image, Text, StyleSheet } from 'react-native'; | |
| const SearchListView = ({ data, navigation }) => { | |
| const ItemView = ({ item }) => { | |
| var resTitle = item.title.substring(0, 50); | |
| var resDesc = item.description.substring(0, 90) ; | |
| return ( | |
| <TouchableOpacity style={styles.cardView} activeOpacity={0.7} |
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 firebaseConfig = { | |
| apiKey: "<api-key>", | |
| authDomain: "<auth-domain>", | |
| databaseURL: "<database-url>", | |
| projectId: "<project-id>", | |
| storageBucket: "<storage-bucket>", | |
| messagingSenderId: "<messaging-sender-id>", | |
| appId: "<app-id>" | |
| }; |
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, useCallback } from 'react'; | |
| import { GiftedChat } from 'react-native-gifted-chat'; | |
| import AsyncStorage from '@react-native-async-storage/async-storage'; | |
| import { | |
| StyleSheet, | |
| TextInput, | |
| View, | |
| LogBox, | |
| Button, | |
| } 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
| useEffect(() => { | |
| readUser(); | |
| const unsubscribe = chatsRef.onSnapshot((querySnapshot) => { | |
| const messagesFirestore = querySnapshot | |
| .docChanges() | |
| .filter(({ type }) => type === 'added') | |
| .map(({ doc }) => { | |
| const message = doc.data(); | |
| return { | |
| ...message, |
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
| async function handlePress() { | |
| const _id = Math.random().toString(36).substring(7); | |
| const user = { _id, name }; | |
| await AsyncStorage.setItem('user', JSON.stringify(user)); | |
| setUser(user); | |
| } | |
| async function handleSend(messages) { | |
| const writes = messages.map((m) => chatsRef.add(m)); | |
| await Promise.all(writes); |
OlderNewer