diff --git a/app/App.js b/app/App.js index 53dba63..0262d92 100644 --- a/app/App.js +++ b/app/App.js @@ -27,17 +27,17 @@ import Staff from './Staff' import OpeningPage from './OpeningPage'; import OpenPage from './OpenPage'; import Ionicons from 'react-native-vector-icons/Ionicons'; -import I18n from './i18n'; +//import I18n from './i18n'; import AsyncStorage from '@react-native-community/async-storage' const Tab = createBottomTabNavigator(); -AsyncStorage.getItem('language') +/*AsyncStorage.getItem('language') .then((token) => { console.log("lang: " + token); I18n.locale = token; }); - +*/ AsyncStorage.getItem('announcementNotifs') .then((token) => { console.log("announcementNotifs: " + token); @@ -86,11 +86,11 @@ class App extends React.Component { fontSize:16 }}} > - - - - - + + + + + : } diff --git a/app/Calendar.js b/app/Calendar.js index 50fd72a..67249bb 100644 --- a/app/Calendar.js +++ b/app/Calendar.js @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +/*import React, {useState} from 'react'; import { SafeAreaView, StyleSheet, @@ -16,7 +16,7 @@ import { } from 'react-native/Libraries/NewAppScreen'; import LinearGradient from 'react-native-linear-gradient'; -import I18n from './i18n'; +//import I18n from './i18n'; import styles from './styles/liststyles' import { url } from './resources/fetchInfo.json' @@ -124,7 +124,8 @@ class Calendar extends React.Component { }) .then((json) => { const data = JSON.parse(json).data - data.sort((a,b)=>new Date(b.date).getTime()-new Date(a.date).getTime()) + data.sort((a,b)=>new Date(b.date).getTime()-new Date(a.date).getTime()) + console.log(data); this.setState({data: data}); }) .catch((error) => console.error(error)) @@ -138,7 +139,149 @@ class Calendar extends React.Component { colors={['#f99', 'white']} style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}} > - {I18n.t('calendar.calendarEvents')} + Calendar Events + + + + } + keyExtractor={item=>JSON.stringify(item)} + /> + + ) + } +} + +export default Calendar;*/ + +import React, {useState} from 'react'; +import { + SafeAreaView, + StyleSheet, + ScrollView, + View, + Text, + StatusBar, + FlatList, + TouchableOpacity, + Image, +} from 'react-native'; + +import { + ReloadInstructions, +} from 'react-native/Libraries/NewAppScreen'; + +import LinearGradient from 'react-native-linear-gradient'; + +import styles from './styles/liststyles' +import { url } from './resources/fetchInfo.json' + +const getCurrentDate=()=>{ + var date = new Date().getDate(); + var month = new Date().getMonth() + 1; + var year = new Date().getFullYear(); + + return year + '-' + month + '-' + date; +} + +const Event = ({item}) => { + const [visible, setVisible] = useState(false) + const date = item.item.date.split('-') + const today = new Date(getCurrentDate()) + const week = new Date().setDate(new Date().getDate() - 8) + const itemDate = new Date(item.item.date) + + const extra = ( + <> + {item.item.text} + Location: {item.item.location} + + ) + if (itemDate >= today) { + return ( + setVisible(!visible)} activeOpacity={0.8}> + + + + {item.item.title} + + + {`${date[1]}/${date[2]}/${date[0]}`} + + + {visible?extra:<>} + + ) + } + else if (itemDate >= week){ + return ( + setVisible(!visible)} activeOpacity={0.8}> + + + + {item.item.title} + + + {`${date[1]}/${date[2]}/${date[0]}`} + + + {visible?extra:<>} + + ) + } + else { + return ( + null + ) + } +} + +class Calendar extends React.Component { + + constructor(props) { + super(props) + this.state = { + data: [] + } + } + + componentDidMount() { + this.getData() + this.props.navigation.addListener( + 'focus', + () => { + this.getData() + } + ); + } + + getData() { + fetch(`${url}/api/en/events`,{ + headers: { + 'Cache-Control': 'no-cache' + } }) + .then((response) => { + return response.text(); + }) + .then((json) => { + const data = JSON.parse(json).data + data.sort((a,b)=>new Date(b.date).getTime()-new Date(a.date).getTime()) + console.log(data); + this.setState({data: data}); + }) + .catch((error) => console.error(error)) + } + + render() { + return ( + + + + Calendar Events diff --git a/app/Clubs.js b/app/Clubs.js index 18b96fc..4ed064a 100644 --- a/app/Clubs.js +++ b/app/Clubs.js @@ -160,7 +160,7 @@ class Clubs extends React.Component { { @@ -339,9 +339,9 @@ function HomeScreen (props) { - {I18n.t('home.whatsNew')} + Whats New props.navigation.navigate('new', {data:props.data})}> - {I18n.t('home.viewAll')} + View All @@ -357,7 +357,7 @@ function HomeScreen (props) { - {I18n.t('home.SOTW')} + Student of the Week @@ -365,22 +365,22 @@ function HomeScreen (props) { {props.studentData.name} - {I18n.t('home.Grade')} {props.studentData.year} + Grade {props.studentData.year} - {I18n.t('home.Hobbies')}: {props.studentData.hobbies} - {I18n.t('home.Achievements')}: {props.studentData.achievements} - {I18n.t('home.Messages')}: {props.studentData.messages} + Hobbies: {props.studentData.hobbies} + Achievements: {props.studentData.achievements} + Messages: {props.studentData.messages} - {I18n.t('home.Announcements')} + Announcements props.navigation.navigate(Announcements)}> - {I18n.t('home.viewAll')} + View All ); } -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/app/More.js b/app/More.js index a6fb682..2877f6b 100644 --- a/app/More.js +++ b/app/More.js @@ -33,7 +33,7 @@ import Settings from './Settings' import Poll from './Poll' import Images from './Images' import LinearGradient from 'react-native-linear-gradient' -import I18n from './i18n'; +//import I18n from './i18n'; const Stack = createStackNavigator() @@ -61,7 +61,7 @@ class MoreSwitch extends React.Component { this.props.navigation.navigate(item.key)}> - {I18n.t('more.'+item.name)} + {item.name} } /> @@ -84,7 +84,7 @@ class More extends React.Component { name="Chooser" component={MoreSwitch} options={{ - title:I18n.t('more.More'), + title:"More", headerTitleStyle:styles.headerTitle, headerBackground: ()=>background }} @@ -93,7 +93,7 @@ class More extends React.Component { name="announce" component={Announcements} options={{ - title:I18n.t('more.Announcements'), + title:"Announcements", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -103,7 +103,7 @@ class More extends React.Component { name="resources" component={Resources} options={{ - title:I18n.t('more.Resources'), + title:"Resources", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -113,7 +113,7 @@ class More extends React.Component { name="studentweek" component={StudentWeek} options={{ - title:I18n.t('more.SOTW'), + title:"Student of the Week", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -123,7 +123,7 @@ class More extends React.Component { name="lunchevent" component={LunchEvents} options={{ - title:I18n.t('more.lunch'), + title:"Lunch", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -133,7 +133,7 @@ class More extends React.Component { name="sslopps" component={SSLOps} options={{ - title:I18n.t('more.ssl'), + title:"SSL Ops", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -143,7 +143,7 @@ class More extends React.Component { name="challengeweek" component={ChallengeWeek} options={{ - title:I18n.t('more.COTW'), + title:"Challenge of the Week", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -153,7 +153,7 @@ class More extends React.Component { name="polls" component={Poll} options={{ - title:I18n.t('more.Polls'), + title:"Polls", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background @@ -163,7 +163,7 @@ class More extends React.Component { name="settings" component={Settings} options={{ - title:I18n.t('more.Settings'), + title:"Settings", headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], headerLeft:null, headerBackground: ()=>background diff --git a/app/Notifications.js b/app/Notifications.js index 69c0754..a7335dd 100644 --- a/app/Notifications.js +++ b/app/Notifications.js @@ -1,4 +1,4 @@ -import React, { Component, useState } from 'react'; +/*import React, { Component, useState } from 'react'; import { Platform, StyleSheet, @@ -119,4 +119,4 @@ class Notifications extends Component { } } -export default Notifications \ No newline at end of file +export default Notifications*/ \ No newline at end of file diff --git a/app/Poll.js b/app/Poll.js index dff9b80..63195cb 100644 --- a/app/Poll.js +++ b/app/Poll.js @@ -1,4 +1,4 @@ -import React from 'react'; +/*import React from 'react'; import { SafeAreaView, StyleSheet, @@ -21,7 +21,7 @@ import {WebView} from 'react-native-webview'; import LinearGradient from 'react-native-linear-gradient'; import { Linking } from 'react-native'; import { url } from './resources/fetchInfo.json' -import I18n from './i18n'; +//import I18n from './i18n'; class Poll extends React.Component { @@ -47,7 +47,7 @@ componentDidMount() { }) .catch((error) => console.error(error)) }*/ - +/* render() { return ( @@ -55,11 +55,47 @@ componentDidMount() { Linking.openURL("https://google.com")}> - {I18n.t('polls.textInPoll')} + Take A Poll! ) } } +export default Poll;*/ +import React from 'react'; +import { + SafeAreaView, + StyleSheet, + ScrollView, + View, + Text, + StatusBar, +} from 'react-native'; + +import { + Header, + LearnMoreLinks, + Colors, + DebugInstructions, + ReloadInstructions, +} from 'react-native/Libraries/NewAppScreen'; +import {WebView} from 'react-native-webview'; +class Poll extends React.Component { + render() { + return ( + + + ) + } +} + export default Poll; \ No newline at end of file diff --git a/app/SSLOps.js b/app/SSLOps.js index 0bad04b..73071a6 100644 --- a/app/SSLOps.js +++ b/app/SSLOps.js @@ -22,7 +22,7 @@ import { NavigationContainer } from '@react-navigation/native' import { createStackNavigator } from '@react-navigation/stack' import styles from './styles/liststyles'; import { url } from './resources/fetchInfo.json'; -import I18n from './i18n'; +//import I18n from './i18n'; const Stack = createStackNavigator(); diff --git a/app/Settings.js b/app/Settings.js index 489a294..c1f2278 100644 --- a/app/Settings.js +++ b/app/Settings.js @@ -26,13 +26,31 @@ import LinearGradient from 'react-native-linear-gradient' import Images from './Images' import { NavigationContainer } from '@react-navigation/native' import { createStackNavigator } from '@react-navigation/stack' -import I18n from './i18n'; -import Language from './Language' -import Notifications from './Notifications' +//import I18n from './i18n'; +//import Language from './Language' +//import Notifications from './Notifications' const Stack = createStackNavigator() -class SettingSwitch extends React.Component { + + + +class placeHoldingForNow extends React.Component{ + constructor(props) { + super(props) + this.props = props + } + render() { + return ( + + + Coming Soon... + + + ) + } +} +/*class SettingSwitch extends React.Component { constructor(props) { super(props) this.props = props @@ -43,8 +61,8 @@ class SettingSwitch extends React.Component { this.props.navigation.navigate(item.key)}> @@ -57,7 +75,7 @@ class SettingSwitch extends React.Component { ) } } - +*/ const background = ( background }} /> - background }} - /> - */} + {/*background }} - /> + />*/} ) diff --git a/app/Staff.js b/app/Staff.js index 442d564..fd4c4d3 100644 --- a/app/Staff.js +++ b/app/Staff.js @@ -23,7 +23,7 @@ import { import { SearchBar } from 'react-native-elements'; import styles from './styles/liststyles' import { url } from './resources/fetchInfo.json' -import I18n from './i18n'; +//import I18n from './i18n'; const StaffElement = ({item}) => { const [visible, setVisible] = useState(false) @@ -108,7 +108,7 @@ class Staff extends React.Component { {this.state.data.name} - {'\t'}{I18n.t('student.Grade')} {this.state.data.year} + {'\t'}Grade: {this.state.data.year} @@ -59,15 +59,15 @@ class StudentWeek extends React.Component { - {"\n"}{I18n.t('student.Hobbies')} + {"\n"}Hobbies: {'\t'}{this.state.data.hobbies} - {"\n"}{I18n.t('student.Achievements')} + {"\n"}Achievements: {'\t'}{this.state.data.achievements} - {"\n"}{I18n.t('student.Messages')} + {"\n"}Messages: {'\t'}{this.state.data.messages} diff --git a/app/i18n.js b/app/i18n.js index ceae366..32e0f8f 100644 --- a/app/i18n.js +++ b/app/i18n.js @@ -1,12 +1,12 @@ -'use strict'; -import I18n from 'react-native-i18n'; -import en from './Languages/en' -import es from './Languages/es' +//'use strict'; +//import I18n from 'react-native-i18n'; +//import en from './Languages/en' +//import es from './Languages/es' -I18n.fallbacks = true; -I18n.translations = { - en, - es, -}; +//I18n.fallbacks = true; +//I18n.translations = { + //en, + //es, +//}; -export default I18n; \ No newline at end of file +//export default I18n; \ No newline at end of file diff --git a/app/resources/fetchInfo.json b/app/resources/fetchInfo.json index bc3cebe..4d31c05 100644 --- a/app/resources/fetchInfo.json +++ b/app/resources/fetchInfo.json @@ -1 +1 @@ -{"url":"http://127.0.0.1:5000"} \ No newline at end of file +{"url":"https://24d524eaf8f5.ngrok.io"} \ No newline at end of file diff --git a/package.json b/package.json index f5e7770..adf44b6 100644 --- a/package.json +++ b/package.json @@ -18,15 +18,11 @@ "@react-navigation/stack": "^5.9.0", "@vitalets/google-translate-api": "^4.0.0", "events": "^3.2.0", - "i18next": "^19.8.4", - "i18next-react-native-language-detector": "^1.0.2", "querystring": "^0.2.0", "react": "16.13.1", - "react-i18next": "^11.8.5", "react-native": "^0.63.2", "react-native-elements": "^2.2.0", "react-native-gesture-handler": "^1.7.0", - "react-native-i18n": "^2.0.15", "react-native-linear-gradient": "^2.5.6", "react-native-locale-detector": "^1.0.1", "react-native-reanimated": "^1.10.2", diff --git a/yarn.lock b/yarn.lock index 85159a7..0a1455d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -711,13 +711,6 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.12.0", "@babel/runtime@^7.3.1": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" - integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.0.0", "@babel/template@^7.10.4", "@babel/template@^7.3.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" @@ -3651,13 +3644,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -html-parse-stringify2@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz#dc5670b7292ca158b7bc916c9a6735ac8872834a" - integrity sha1-3FZwtyksoVi3vJFsmmc1rIhyg0o= - dependencies: - void-elements "^2.0.1" - http-cache-semantics@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" @@ -3696,23 +3682,6 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -i18n-js@3.0.11: - version "3.0.11" - resolved "https://registry.yarnpkg.com/i18n-js/-/i18n-js-3.0.11.tgz#f9e96bdb641c5b9d6be12759d7c422089987ef02" - integrity sha512-v7dG3kYJTQTyox3NqDabPDE/ZotWntyMI9kh4cYi+XlCSnsIR+KBTS2opPyObL8WndnklcLzbNU92FP/mLge3Q== - -i18next-react-native-language-detector@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/i18next-react-native-language-detector/-/i18next-react-native-language-detector-1.0.2.tgz#5c47482611a44262302a363d5be34a42b11ddfc6" - integrity sha1-XEdIJhGkQmIwKjY9W+NKQrEd38Y= - -i18next@^19.8.4: - version "19.8.4" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.8.4.tgz#447718f2a26319b8debdbcc6fbc1a9761be7316b" - integrity sha512-FfVPNWv+felJObeZ6DSXZkj9QM1Ivvh7NcFCgA8XPtJWHz0iXVa9BUy+QY8EPrCLE+vWgDfV/sc96BgXVo6HAA== - dependencies: - "@babel/runtime" "^7.12.0" - iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -5437,11 +5406,6 @@ mkdirp@^0.5.1: dependencies: minimist "^1.2.5" -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -6055,13 +6019,6 @@ prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -properties-reader@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/properties-reader/-/properties-reader-2.2.0.tgz#41d837fe143d8d5f2386b6a869a1975c0b2c595c" - integrity sha512-CgVcr8MwGoBKK24r9TwHfZkLLaNFHQ6y4wgT9w/XzdpacOOi5ciH4hcuLechSDAwXsfrGQtI2JTutY2djOx2Ow== - dependencies: - mkdirp "^1.0.4" - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -6127,14 +6084,6 @@ react-devtools-core@^4.6.0: shell-quote "^1.6.1" ws "^7" -react-i18next@^11.8.5: - version "11.8.5" - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.8.5.tgz#a093335822e36252cda6efc0f55facef6253643f" - integrity sha512-2jY/8NkhNv2KWBnZuhHxTn13aMxAbvhiDUNskm+1xVVnrPId78l8fA7fCyVeO3XU1kptM0t4MtvxV1Nu08cjLw== - dependencies: - "@babel/runtime" "^7.3.1" - html-parse-stringify2 "2.0.1" - react-is@^16.12.0, react-is@^16.13.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -6165,13 +6114,6 @@ react-native-gesture-handler@^1.7.0: invariant "^2.2.4" prop-types "^15.7.2" -react-native-i18n@^2.0.15: - version "2.0.15" - resolved "https://registry.yarnpkg.com/react-native-i18n/-/react-native-i18n-2.0.15.tgz#09b5a9836116fa7dbd0054c46e2d1014c1ef3c65" - integrity sha512-V8VwUP0TLda3oJvgt5tdnFaOV7WXPhTjCTLO7sXI3C2SHggSbD4bCUryMzNJhesimJidH21V2Owvj4zAylHoQQ== - dependencies: - i18n-js "3.0.11" - react-native-iphone-x-helper@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.0.tgz#84fd13e6b89cc3aa4daa80ec514bf15cb724d86d" @@ -7588,11 +7530,6 @@ vlq@^1.0.0: resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== -void-elements@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - w3c-hr-time@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"