1- import { Alert , FlatList , NativeModules , View } from 'react-native' ;
1+ import { Alert , FlatList , NativeModules , StyleSheet , View } from 'react-native' ;
22import { LoopHabit , PersistentTask } from '../types' ;
33import { useCallback , useState } from 'react' ;
44
@@ -185,9 +185,9 @@ function HabitList() {
185185 const tasks = useTodoistTasks ( ) ;
186186 console . debug ( new Date ( ) , tasks . length ) ;
187187 return (
188- < View style = { { flex : 1 } } >
188+ < View style = { styles . container } >
189189 { tasks . length === 0 ? (
190- < View style = { { flex : 1 , justifyContent : 'center' , marginHorizontal : "10%" } } >
190+ < View style = { styles . empty } >
191191 < Text >
192192 < Text > No recently completed recurring tasks found in Todoist.</ Text >
193193 < Text > { '\n\n' } </ Text >
@@ -201,11 +201,17 @@ function HabitList() {
201201 data = { tasks }
202202 renderItem = { ( { item } ) => < Habit item = { item } /> }
203203 keyExtractor = { item => item . id }
204- contentContainerStyle = { { gap : 8 , padding : 8 } }
204+ contentContainerStyle = { styles . contentContainer }
205205 />
206206 ) }
207207 </ View >
208208 ) ;
209209}
210210
211+ const styles = StyleSheet . create ( {
212+ container : { flex : 1 } ,
213+ contentContainer : { gap : 8 , padding : 8 } ,
214+ empty : { flex : 1 , justifyContent : 'center' , marginHorizontal : "10%" } ,
215+ } ) ;
216+
211217export default HabitList ;
0 commit comments