Skip to content

Commit cddc674

Browse files
committed
Refactor weather store and utility functions; add demo weather data
1 parent 2f1a1d7 commit cddc674

16 files changed

Lines changed: 1719 additions & 211 deletions

File tree

App.tsx

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ import RandomPassword from '@screens/Try/RandomPassword'
4848
import YourAge from '@screens/Try/YourAge'
4949
import Update, { type UpdateParamList } from '@screens/Update/Update'
5050
import type { ConfirmCityParamList } from '@screens/Weather/ConfirmCity'
51-
import { type WeatherLocationParamList } from '@screens/Weather/WeatherLocation'
52-
import { type SearchCityParamList } from '@screens/Weather/WeatherSearchCity'
51+
import WeatherLocation, { type WeatherLocationParamList } from '@screens/Weather/WeatherLocation'
52+
import WeatherSearchCity, { type SearchCityParamList } from '@screens/Weather/WeatherSearchCity'
5353
import Login from '@screens/auth/Login'
5454
import Signup from '@screens/auth/Signup'
5555
import Verify, { type VerifyParamList } from '@screens/auth/Verify'
@@ -63,6 +63,28 @@ import { Dimensions, SafeAreaView, useColorScheme } from 'react-native'
6363
import { GestureHandlerRootView } from 'react-native-gesture-handler'
6464
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated'
6565
import './global.css'
66+
import Animations from '@screens/Animations'
67+
import ConfirmCity from '@screens/Weather/ConfirmCity'
68+
import WeatherScreen from '@screens/Weather/Main/Weather'
69+
import AtmPressureUnit from '@screens/Weather/Settings/AtmPressureUnit'
70+
import DistanceUnit from '@screens/Weather/Settings/DistanceUnit'
71+
import TempUnit from '@screens/Weather/Settings/TempUnit'
72+
import TimeFormatUnit from '@screens/Weather/Settings/TimeFormatUnit'
73+
import WeatherScienceSettings from '@screens/Weather/Settings/WeatherSettings'
74+
import WindSpeedUnit from '@screens/Weather/Settings/WindSpeedUnit'
75+
import WeatherWelcome from '@screens/Weather/WeatherWelcome'
76+
import ApplyingModifiers from '@screens/animations/ApplyingModifiers'
77+
import Basic from '@screens/animations/Basic'
78+
import CompassAnimation from '@screens/animations/CompassAnimation'
79+
import CustomizingAnimations from '@screens/animations/CustomizingAnimations'
80+
import DragAnimation from '@screens/animations/DragAnimation'
81+
import HandlingGesture from '@screens/animations/HandlingGesture'
82+
import KeyboardAnimation from '@screens/animations/KeyboardAnimation'
83+
import LevelAnimation from '@screens/animations/LevelAnimation'
84+
import ParallaxWallpaper from '@screens/animations/ParallaxWallpaper'
85+
import SensorAnimation from '@screens/animations/SensorAnimation'
86+
import StableBox from '@screens/animations/StableBox'
87+
import StableWallpaper from '@screens/animations/StableWallpaper'
6688

6789
function App(): React.JSX.Element {
6890
const scheme = useColorScheme()
@@ -128,47 +150,46 @@ function Navigation() {
128150
<Stack.Screen name='AllUsers' component={AllUsers} options={GestureEnabled} />
129151
<Stack.Screen name='Skia' component={Skia} options={GestureEnabled} />
130152
{/* <Stack.Screen name='Location' component={Location} /> */}
131-
{/* <Stack.Screen name='CompassAnimation' component={CompassAnimation} /> */}
132-
{/* <Stack.Screen name='ParallaxWallpaper' component={ParallaxWallpaper} /> */}
133-
{/* <Stack.Screen name='LevelAnimation' component={LevelAnimation} /> */}
134-
{/* <Stack.Screen name='StableWallpaper' component={StableWallpaper} /> */}
135-
{/* <Stack.Screen name='StableBox' component={StableBox} /> */}
136-
{/* <Stack.Screen name='HandlingGesture' component={HandlingGesture} /> */}
137-
{/* <Stack.Screen name='SensorAnimation' component={SensorAnimation} /> */}
138-
{/* <Stack.Screen name='ApplyingModifiers' component={ApplyingModifiers} /> */}
139-
{/* <Stack.Screen name='CustomizingAnimations' component={CustomizingAnimations} /> */}
140-
{/* <Stack.Screen name='Basic' component={Basic} /> */}
141-
{/* <Stack.Screen name='Basic' component={Basic} /> */}
142-
{/* <Stack.Screen name='KeyboardAnimation' component={KeyboardAnimation} /> */}
153+
<Stack.Screen name='CompassAnimation' component={CompassAnimation} />
154+
<Stack.Screen name='ParallaxWallpaper' component={ParallaxWallpaper} />
155+
<Stack.Screen name='LevelAnimation' component={LevelAnimation} />
156+
<Stack.Screen name='StableWallpaper' component={StableWallpaper} />
157+
<Stack.Screen name='StableBox' component={StableBox} />
158+
<Stack.Screen name='HandlingGesture' component={HandlingGesture} />
159+
<Stack.Screen name='SensorAnimation' component={SensorAnimation} />
160+
<Stack.Screen name='ApplyingModifiers' component={ApplyingModifiers} />
161+
<Stack.Screen name='CustomizingAnimations' component={CustomizingAnimations} />
162+
<Stack.Screen name='Basic' component={Basic} />
163+
<Stack.Screen name='KeyboardAnimation' component={KeyboardAnimation} />
143164
{/* <Stack.Screen name='Animations' component={Animations} /> */}
144-
{/* <Stack.Screen name='DragAnimation' component={DragAnimation} /> */}
145-
{/* <Stack.Screen name='Weather' component={WeatherScreen} options={GestureEnabled} /> */}
146-
{/* <Stack.Screen name='WeatherWelcome' component={WeatherWelcome} options={IOS_BOTTOM_STYLE} /> */}
147-
{/* <Stack.Screen name='WeatherSearchCity' component={WeatherSearchCity} options={IOS_BOTTOM_STYLE} /> */}
148-
{/* <Stack.Screen name='WeatherLocation' component={WeatherLocation} options={IOS_BOTTOM_STYLE} /> */}
165+
<Stack.Screen name='DragAnimation' component={DragAnimation} />
166+
<Stack.Screen name='Weather' component={WeatherScreen} options={GestureEnabled} />
167+
<Stack.Screen name='WeatherWelcome' component={WeatherWelcome} options={IOS_BOTTOM_STYLE} />
168+
<Stack.Screen name='WeatherSearchCity' component={WeatherSearchCity} options={IOS_BOTTOM_STYLE} />
169+
<Stack.Screen name='WeatherLocation' component={WeatherLocation} options={IOS_BOTTOM_STYLE} />
149170
<Stack.Screen name='Greeting' component={Greeting} options={IOS_BOTTOM_STYLE} />
150171
<Stack.Screen name='Settings' component={Settings} options={GestureEnabled} />
151172
<Stack.Screen name='EditVersion' component={EditVersion} options={GestureEnabled} />
152173
<Stack.Screen name='Explore' component={Explore} />
153174
<Stack.Screen name='RoutineWelcome' component={RoutineWelcome} options={IOS_BOTTOM_STYLE} />
154175
<Stack.Screen name='NotesWelcome' component={NotesWelcome} options={IOS_BOTTOM_STYLE} />
155176
<Stack.Screen name='ComputerScienceSettings' component={ComputerScienceSettings} options={GestureEnabled} />
156-
{/* <Stack.Screen name='ConfirmCity' component={ConfirmCity} options={IOS_BOTTOM_STYLE} /> */}
157-
{/* <Stack.Screen
177+
<Stack.Screen name='ConfirmCity' component={ConfirmCity} options={IOS_BOTTOM_STYLE} />
178+
<Stack.Screen
158179
name='WeatherSettings'
159180
component={WeatherScienceSettings}
160181
options={{ gestureEnabled: true, freezeOnBlur: true }}
161-
/> */}
182+
/>
162183
<Stack.Screen name='DeveloperOptions' component={DeveloperOptions} options={GestureEnabled} />
163184
<Stack.Screen name='UiAndComponents' component={UiAndComponents} options={GestureEnabled} />
164185
<Stack.Screen name='BlankSettings' component={BlankSettings} options={GestureEnabled} />
165186
<Stack.Screen name='MMKVDataList' component={MMKVDataList} options={GestureEnabled} />
166187
<Stack.Screen name='MMKVDataEditor' component={MMKVDataEditor} options={GestureEnabled} />
167-
{/* <Stack.Screen name='TempUnit' component={TempUnit} options={GestureEnabled} /> */}
168-
{/* <Stack.Screen name='DistanceUnit' component={DistanceUnit} options={GestureEnabled} /> */}
169-
{/* <Stack.Screen name='WindSpeedUnit' component={WindSpeedUnit} options={GestureEnabled} /> */}
170-
{/* <Stack.Screen name='AtmPressureUnit' component={AtmPressureUnit} options={GestureEnabled} /> */}
171-
{/* <Stack.Screen name='TimeFormatUnit' component={TimeFormatUnit} options={GestureEnabled} /> */}
188+
<Stack.Screen name='TempUnit' component={TempUnit} options={GestureEnabled} />
189+
<Stack.Screen name='DistanceUnit' component={DistanceUnit} options={GestureEnabled} />
190+
<Stack.Screen name='WindSpeedUnit' component={WindSpeedUnit} options={GestureEnabled} />
191+
<Stack.Screen name='AtmPressureUnit' component={AtmPressureUnit} options={GestureEnabled} />
192+
<Stack.Screen name='TimeFormatUnit' component={TimeFormatUnit} options={GestureEnabled} />
172193
<Stack.Screen name='ManageStorage' component={ManageStorage} options={GestureEnabled} />
173194
<Stack.Screen name='BackupAndRestore' component={BackupAndRestore} options={GestureEnabled} />
174195
<Stack.Screen name='About' component={About} options={GestureEnabled} />
@@ -179,7 +200,6 @@ function Navigation() {
179200
<Stack.Screen name='RandomPassword' component={RandomPassword} options={GestureEnabled} />
180201
<Stack.Screen name='GlobalSearch' component={GlobalSearch} options={IOS_BOTTOM_STYLE} />
181202
<Stack.Screen name='Update' component={Update} options={GestureEnabled} />
182-
{/* <Stack.Screen name='ForceUpdate' component={Update} options={GestureEnabled} /> */}
183203
<Stack.Screen name='Devices' component={Devices} options={GestureEnabled} />
184204
<Stack.Screen name='Device' component={Device} options={GestureEnabled} />
185205
<Stack.Screen

bun.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
"scripts": {
66
"android": "react-native run-android --active-arch-only",
77
"ios": "react-native run-ios",
8-
"lint": "biome lint",
9-
"eslint": "eslint . --fix",
10-
"format": "biome format --write",
8+
"lint": "eslint . --fix",
9+
"format": "prettier --write .",
1110
"dev": "react-native start",
1211
"test": "jest",
1312
"build": "cd android && gradlew assembleRelease && cd .. && npm run install-release-apk",
@@ -68,14 +67,14 @@
6867
"@typescript/native-preview": "^7.0.0-dev.20250803.1",
6968
"babel-jest": "^29.7.0",
7069
"babel-plugin-module-resolver": "^5.0.2",
71-
"eslint": "^8.57.1",
72-
"jest": "^29.7.0",
73-
"prettier": "^3.5.3",
7470
"prettier-plugin-tailwindcss": "^0.6.12",
7571
"react-native-svg-transformer": "^1.5.1",
76-
"react-test-renderer": "^19.0.0",
7772
"tailwindcss": "^3.4.17",
78-
"typescript": "^5.8.3"
73+
"eslint": "^8.19.0",
74+
"jest": "^29.6.3",
75+
"prettier": "2.8.8",
76+
"react-test-renderer": "19.1.0",
77+
"typescript": "5.0.4"
7978
},
8079
"engines": {
8180
"node": ">=18"

src/screens/Home/HomeScreen.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Dimensions, TouchableOpacity, View } from 'react-native'
1212
import { ScrollView } from 'react-native-gesture-handler'
1313
import CheckVersion from './CheckVersion'
1414
import styles, { hw as height_weight } from './style'
15+
import WeatherWidget from '@screens/Weather/Widget/WeatherWidget'
1516

1617
const { width } = Dimensions.get('window')
1718

@@ -74,7 +75,7 @@ function Elements() {
7475
contentContainerStyle={{ gap: 12, paddingLeft: 18, paddingRight: 18, paddingTop: 5, paddingBottom: 5 }}
7576
snapToAlignment='center'
7677
>
77-
{/* <WeatherWidget navigation={navigation} /> */}
78+
<WeatherWidget navigation={navigation} />
7879
<TouchableOpacity
7980
style={[height_weight, styles.shadow]}
8081
className='items-center justify-center rounded-3xl bg-white dark:bg-zinc-900'
@@ -87,7 +88,7 @@ function Elements() {
8788
style={[height_weight, styles.shadow]}
8889
className='items-center justify-center rounded-3xl bg-white dark:bg-zinc-900'
8990
activeOpacity={0.7}
90-
onPress={() => navigation.navigate('NotesWelcome')}
91+
onPress={() => navigation.navigate('Weather')}
9192
>
9293
<Medium className='text-xs text-gray-800 dark:text-gray-200'>Notes</Medium>
9394
</TouchableOpacity>

src/screens/Settings/Settings/Settings.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { ToastAndroid, View, useColorScheme } from 'react-native'
4646
import { ScrollView } from 'react-native-gesture-handler'
4747
import Animated, { FadeIn } from 'react-native-reanimated'
4848
import AdminSettings from './AdminSettings'
49+
import SunCloudAngledRainZap01Icon from '@hugeicons/SunCloudAngledRainZap01Icon'
4950

5051
function SettingsHeader({ title, Title }: { title?: string; Title?: React.ReactNode }) {
5152
const [search, setSearch] = React.useState('')
@@ -126,13 +127,13 @@ export default function Settings({ navigation }: NavProp) {
126127
onPress={() => navigation.navigate('YourProfile')}
127128
/>
128129
<SettOption title='Computer Science' Icon={<RoundIcon Icon={ComputerIcon} />} arrow />
129-
{/* <SettOption
130+
<SettOption
130131
title='Weather Settings'
131132
// Icon={<SunCloudAngledRainZap01Icon {...ic} />}
132133
Icon={<RoundIcon Icon={SunCloudAngledRainZap01Icon} className='bg-blue-500' />}
133134
onPress={() => navigation.navigate('WeatherSettings')}
134135
arrow
135-
/> */}
136+
/>
136137
<SettOption
137138
title='Routine Management'
138139
Icon={<RoundIcon Icon={Calendar03Icon} className='bg-red-500' />}

0 commit comments

Comments
 (0)