-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d061cb2
commit 3cd2751
Showing
28 changed files
with
15,446 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { StatusBar } from "react-native"; | ||
import { StyleSheet,Text,View,SafeAreaView } from "react-native"; | ||
import AppNavigation from "./navigation/appNavigation"; | ||
|
||
export default function App(){ | ||
return( | ||
<AppNavigation/> | ||
) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import axios from "axios"; | ||
|
||
let apiKey="153ab2c85b5646d9a58162344241905" | ||
|
||
const forecastEndpoint=params=>`http://api.weatherapi.com/v1/forecast.json?key=${apiKey}&q=${params.city}&days=7&aqi=no&alerts=no | ||
` | ||
const locationsEndpoint=params=>`http://api.weatherapi.com/v1/search.json?key=${apiKey}&q=${params.city}` | ||
|
||
const apiCall = async(endpoint)=>{ | ||
const options={ | ||
method:'GET', | ||
url:endpoint | ||
} | ||
try { | ||
const response = await axios.request(options) | ||
return response.data | ||
} catch (error) { | ||
console.log('error: ',error) | ||
return null | ||
} | ||
} | ||
|
||
export const fetchForecast = params =>{ | ||
let forecastUrl=forecastEndpoint(params) | ||
return apiCall(forecastUrl) | ||
} | ||
|
||
export const fetchLocation = params =>{ | ||
let locationUrl=locationsEndpoint(params) | ||
return apiCall(locationUrl) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export const weatherImages={ | ||
'Partly Cloudy ':require('../assets/images/partlycloudy.png'), | ||
'Partly cloudy':require('../assets/images/partlycloudy.png'), | ||
'Moderate rain':require('../assets/images/moderaterain.png'), | ||
'Patchy rain possible':require('../assets/images/moderaterain.png'), | ||
'Patchy rain nearby':require('../assets/images/moderaterain.png'), | ||
'Sunny':require('../assets/images/sun.png'), | ||
'Clear':require('../assets/images/sun.png'), | ||
'Overcast':require('../assets/images/cloud.png'), | ||
'Cloudy':require('../assets/images/cloud.png'), | ||
'Light rain':require('../assets/images/moderaterain.png'), | ||
'Moderate rain at times':require('../assets/images/moderaterain.png'), | ||
'Heavy rain':require('../assets/images/heavyrain.png'), | ||
'Heavy rain at times':require('../assets/images/heavyrain.png'), | ||
'Moderate or heavy freezing rain':require('../assets/images/heavyrain.png'), | ||
'Moderate or heavy rain shower':require('../assets/images/heavyrain.png'), | ||
'Moderate or heavy rain with thunder':require('../assets/images/heavyrain.png'), | ||
'Mist':require('../assets/images/mist.png'), | ||
'other':require('../assets/images/moderaterain.png'), | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @format | ||
*/ | ||
|
||
import {AppRegistry} from 'react-native'; | ||
import App from './App'; | ||
import {name as appName} from './app.json'; | ||
|
||
AppRegistry.registerComponent(appName, () => App); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import { NavigationContainer } from '@react-navigation/native' | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack' | ||
import HomeScreen from '../screens/HomeScreen' | ||
import { LogBox } from 'react-native' | ||
|
||
const Stack=createNativeStackNavigator() | ||
|
||
LogBox.ignoreLogs([ | ||
'Non-serializable values were found in the navigation state', | ||
]) | ||
|
||
export default function AppNavigation() { | ||
return ( | ||
<NavigationContainer> | ||
<Stack.Navigator> | ||
<Stack.Screen name="Home" options={{headerShown:false}} component={HomeScreen}/> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
) | ||
} |
Oops, something went wrong.