@@ -4,6 +4,7 @@ import { Canvas, LinearGradient, Rect, vec } from '@shopify/react-native-skia'
44import { useMutation } from '@tanstack/react-query'
55import { WeatherColors } from '@utils/colors'
66import { H , W } from '@utils/dimensions'
7+ import { F , Medium , Regular , SemiBold } from '@utils/fonts'
78import type { NavProp , Theme } from '@utils/types'
89import React , { useCallback , useEffect , useMemo } from 'react'
910import { StatusBar , View } from 'react-native'
@@ -20,6 +21,7 @@ import FeelsLike, { getFeelsLikeStatusString } from './components/FeelsLike'
2021import Header from './components/Header'
2122import HourlyForecast from './components/HourlyForecast'
2223import Humidity from './components/Humidity'
24+ import MoonPhase from './components/MoonPhase'
2325import Precipitation from './components/Precipitation'
2426import Pressure from './components/Pressure'
2527import SunRiseSet from './components/SunRiseSet'
@@ -64,10 +66,6 @@ export default function WeatherScreen({ navigation }: NavProp) {
6466 } )
6567 const w = data || currentWeather
6668
67- useEffect ( ( ) => {
68- console . log ( currentCity )
69- } , [ currentCity ] )
70-
7169 useEffect ( ( ) => {
7270 if ( currentCity ) mutate ( )
7371 // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -98,7 +96,7 @@ export default function WeatherScreen({ navigation }: NavProp) {
9896 < PaddingTop />
9997 < Header navigation = { navigation } color = { color } isPending = { isPending } />
10098 </ View >
101- < ScrollView contentContainerStyle = { { paddingBottom : 100 , gap : 12 } } >
99+ < ScrollView contentContainerStyle = { { paddingBottom : bottom + 20 , gap : 12 } } >
102100 < WeatherTopInfo color = { color } w = { w } />
103101 < HourlyForecast color = { color } w = { w } hourly = { data ?. hourly } />
104102 < DailyForecast color = { color } daily = { data ?. daily } theme = { theme } />
@@ -164,7 +162,18 @@ function Boxes({ w, theme }: { w: Weather; theme: Theme }) {
164162 < AirQualityIndex aqi = { currentAQI ?. list ?. [ 0 ] ?. main ?. aqi } theme = { theme } aqiStatus = { aqiStatus } />
165163 < Cloudiness theme = { theme } clouds = { w ?. current . clouds || 0 } />
166164 < Precipitation theme = { theme } rain = { w ?. daily [ 0 ] ?. rain } snow = { w ?. daily [ 0 ] ?. snow } status = { rainStatus } />
167- < SunRiseSet w = { w } theme = { theme } now = { w ?. current ?. dt } sunrise = { w ?. current ?. sunrise } sunset = { w ?. current ?. sunset } />
165+ < SunRiseSet theme = { theme } now = { w ?. current ?. dt } sunrise = { w ?. current ?. sunrise } sunset = { w ?. current ?. sunset } />
166+ < MoonPhase
167+ theme = { theme }
168+ moonrise = { w ?. daily [ 0 ] ?. moonrise }
169+ moonset = { w ?. daily [ 0 ] ?. moonset }
170+ phase = { w ?. daily [ 0 ] ?. moon_phase }
171+ />
172+ < View className = 'w-full items-center justify-center' >
173+ < SemiBold className = 'mt-5 text-center opacity-50' style = { F . F10 } >
174+ Powered by OpenWeatherMap
175+ </ SemiBold >
176+ </ View >
168177 </ View >
169178 )
170179}
0 commit comments