Commit 7d9699f8 by tungnq

TODO: tách component BodySection từ renderBody và bỏ qua cảnh báo Reanimated "Reduced motion"

- Tách phần thân HomeView thành component BodySection để dễ tái sử dụng/đọc code
- Sửa lỗi single-child cho TouchableWithoutFeedback (renderBody() làm 1 element)
- Thêm LogBox.ignoreLogs để ẩn cảnh báo "[Reanimated] Reduced motion setting is enabled"
parent f8b81767
...@@ -3,18 +3,19 @@ import { ...@@ -3,18 +3,19 @@ import {
Text, Text,
View, View,
TouchableOpacity, TouchableOpacity,
StyleSheet,
ScrollView, ScrollView,
Dimensions,
Modal, Modal,
Animated, Animated,
SafeAreaView, LogBox
} from 'react-native'; } from 'react-native';
import R from '../../assets/R'; import R from '../../assets/R';
import {styles, CELL_WIDTH, BOTTOM_SHEET_HEIGHT} from './style'; import {styles} from './style';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import * as SCREENNAME from '../../routers/ScreenNames'; import * as SCREENNAME from '../../routers/ScreenNames';
LogBox.ignoreLogs([
'[Reanimated] Reduced motion setting is enabled',
]);
const ClassScheduleView = ({ const ClassScheduleView = ({
currentDate, currentDate,
selectedDate, selectedDate,
...@@ -102,7 +103,8 @@ const ClassScheduleView = ({ ...@@ -102,7 +103,8 @@ const ClassScheduleView = ({
!isInCurrentMonth && {backgroundColor: R.colors.gray}, !isInCurrentMonth && {backgroundColor: R.colors.gray},
]} ]}
onPress={() => handleDatePress(date)} onPress={() => handleDatePress(date)}
activeOpacity={0.7}> activeOpacity={0.7}
>
<Text <Text
style={[ style={[
styles.dayText, styles.dayText,
......
...@@ -149,27 +149,33 @@ const HomeView = ({ ...@@ -149,27 +149,33 @@ const HomeView = ({
); );
}; };
const renderBody = () => {
return (
<View style={styles.container_body}>
<ImageBackground
source={R.images.igBackground}
style={styles.background_header}>
<HeaderCus value={searchText} onChangeText={onSearchChange} />
{cardItemInfo()}
</ImageBackground>
<ScrollView
showsVerticalScrollIndicator={false}
style={styles.scroll}
bounces={false}
overScrollMode="never">
{renderMenuActivity()}
{renderMenuStatistics()}
{renderMenuNotification()}
</ScrollView>
</View>
);
};
return ( return (
<View style={styles.safeArea}> <View style={styles.safeArea}>
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}> <TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<View style={styles.container_body}> {renderBody()}
<ImageBackground
source={R.images.igBackground}
style={styles.background_header}>
<HeaderCus value={searchText} onChangeText={onSearchChange} />
{cardItemInfo()}
</ImageBackground>
<ScrollView
showsVerticalScrollIndicator={false}
style={styles.scroll}
bounces={false}
overScrollMode="never">
{renderMenuActivity()}
{renderMenuStatistics()}
{renderMenuNotification()}
</ScrollView>
</View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
</View> </View>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment