From bdc9f1c184f0d242733f58cb9127adf0427fef8f Mon Sep 17 00:00:00 2001 From: Janice2024 Date: Tue, 29 Oct 2024 18:54:12 -0400 Subject: [PATCH 1/5] text reading page with changing font size --- src/Screens/CurriculumText/defaultCSS.tsx | 97 +++++++++++++++++++++++ src/Screens/CurriculumText/index.tsx | 86 ++++++++++++++++++++ src/Screens/Home/index.tsx | 2 + src/Screens/PersonalPage/index.tsx | 2 +- 4 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 src/Screens/CurriculumText/defaultCSS.tsx create mode 100644 src/Screens/CurriculumText/index.tsx diff --git a/src/Screens/CurriculumText/defaultCSS.tsx b/src/Screens/CurriculumText/defaultCSS.tsx new file mode 100644 index 0000000..fe66d07 --- /dev/null +++ b/src/Screens/CurriculumText/defaultCSS.tsx @@ -0,0 +1,97 @@ +import { StyleSheet } from 'react-native'; +import styles from '../../Styles/defaultCSS'; + +const stylesheet = StyleSheet.create({ + container: { + height: '100%', + width: '100%' + }, + buttonContainer: { + flexDirection: 'row', + justifyContent: 'space-around', + padding: 0, + marginTop: 5, + }, + button:{ + padding: 0, + borderRadius: 10, + alignItems: 'center', + margin: 5, + }, + buttonText: { + fontSize: 20, // Default font size for other buttons + // color: '#fff', + fontWeight: 'bold', + }, + scrollContainer: { + flexGrow: 1, + justifyContent: 'center', + alignItems: 'center', + padding: 20, + marginTop:0, + }, + centerContent: { + flex: 3, + justifyContent: 'center', + alignItems: 'center', + padding: 10, + // marginBottom:20, + }, + text: { + textAlign: 'justify', + lineHeight: 30, + // fontSize: 20, + }, + + textNormal: { ...styles.textNormal }, + header: { + ...styles.defaultText, + textAlign: 'center', + padding: 10, + fontSize: 33, + fontWeight: 'bold' + }, + subheader: { + ...styles.subheaderText + }, + row: { + flexDirection: 'row', + flexWrap: 'nowrap', + justifyContent: 'space-around', + gap: 15, + flexGrow: 1 + }, + itemTitle: { + fontWeight: 'bold', + fontSize: 20, + padding: 5, + paddingHorizontal: 30, + textAlign: 'center', + ...styles.defaultText, + }, + itemText: { + fontSize: 16, + padding: 5, + textAlign: 'center', + ...styles.content + }, + rowItem: { + borderColor: styles.defaultColor, + borderWidth: .5, + borderBottomLeftRadius: 12, + borderBottomRightRadius: 12, + borderTopLeftRadius: 12, + borderTopRightRadius: 12, + flex: 1, + padding: 15, + alignItems: 'center', + textAlign: 'center', + }, + section: + { + rowGap: 15, + padding: 30, + + } +}); +export default stylesheet; \ No newline at end of file diff --git a/src/Screens/CurriculumText/index.tsx b/src/Screens/CurriculumText/index.tsx new file mode 100644 index 0000000..7b3e5b0 --- /dev/null +++ b/src/Screens/CurriculumText/index.tsx @@ -0,0 +1,86 @@ +// import { Image, View, } from 'react-native'; +import { TouchableOpacity, Image, ScrollView, View, StyleSheet } from 'react-native'; +import BackgroundWrapper from '../../Components/BackgroundWrapper'; +import Button from '../../Components/Button'; +import Text from '../../Components/Text'; +import styles from './defaultCSS'; +import PracticeSession from '../../Assets/svg/practice_session.svg'; +import AssignTasks from '../../Assets/svg/assign_tasks.svg'; +import { Appbar } from 'react-native-paper'; + +import React, { useState } from 'react'; + +// import React from 'react'; +// import { ScrollView, View, StyleSheet } from 'react-native'; + + +const Index = ({ navigation }) => { + const [fontSize, setFontSize] = useState(20); // Initial font size + const [eyeProtectMode, setEyeProtectMode] = useState(false); // Eye protect mode state + const longText = ` + This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. + This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. + This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. + This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. + This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. This is a sample text. + + This is a sample text. This is a sample text. + This is a sample text. This is a sample text. + This is a sample text. This is a sample text. + This is a sample text. This is a sample text. + This is a sample text. This is a sample text. + `; + + const increaseFontSize = () => setFontSize(fontSize + 2); + const decreaseFontSize = () => setFontSize(fontSize > 10 ? fontSize - 2 : fontSize); + const toggleEyeProtectMode = () => setEyeProtectMode(!eyeProtectMode); // Toggle eye protect mode + + +// + return ( + + navigation.navigate('Login')} /> + + Reading for Today + + + + + {/*