diff --git a/components/BaseContainer.js b/components/BaseContainer.js index 38ba60a..7c97a98 100644 --- a/components/BaseContainer.js +++ b/components/BaseContainer.js @@ -5,7 +5,7 @@ import {Container} from "native-base"; import CustomHeader from "./CustomHeader"; import CustomSideMenu from "./CustomSideMenu"; import CustomMaterialIcon from "./CustomMaterialIcon"; -import {Platform, View, StatusBar} from "react-native"; +import {Platform, StatusBar, View} from "react-native"; import ThemeManager from "../utils/ThemeManager"; import Touchable from "react-native-platform-touchable"; import {ScreenOrientation} from "expo"; @@ -32,9 +32,6 @@ type State = { export default class BaseContainer extends React.Component { - willBlurSubscription: function; - willFocusSubscription: function; - static defaultProps = { headerRightButton: , hasTabs: false, @@ -43,8 +40,8 @@ export default class BaseContainer extends React.Component { enableRotation: false, hideHeaderOnLandscape: false, }; - - + willBlurSubscription: function; + willFocusSubscription: function; state = { isOpen: false, isHeaderVisible: true, @@ -66,7 +63,7 @@ export default class BaseContainer extends React.Component { componentDidMount() { this.willFocusSubscription = this.props.navigation.addListener( 'willFocus', - payload => { + () => { if (this.props.enableRotation) { ScreenOrientation.unlockAsync(); ScreenOrientation.addOrientationChangeListener((OrientationChangeEvent) => { @@ -87,7 +84,7 @@ export default class BaseContainer extends React.Component { }); this.willBlurSubscription = this.props.navigation.addListener( 'willBlur', - payload => { + () => { if (this.props.enableRotation) ScreenOrientation.lockAsync(ScreenOrientation.Orientation.PORTRAIT); this.setState({isOpen: false}); diff --git a/components/CustomHeader.js b/components/CustomHeader.js index ea10dcf..71bd2ef 100644 --- a/components/CustomHeader.js +++ b/components/CustomHeader.js @@ -1,7 +1,7 @@ // @flow import * as React from "react"; -import {Body, Header, Input, Item, Left, Right, Title, Form} from "native-base"; +import {Body, Header, Input, Item, Left, Right, Title} from "native-base"; import {Platform, StyleSheet, View} from "react-native"; import {getStatusBarHeight} from "react-native-status-bar-height"; import Touchable from 'react-native-platform-touchable'; diff --git a/components/FetchedDataSectionList.js b/components/FetchedDataSectionList.js index abb74ed..65f6e7a 100644 --- a/components/FetchedDataSectionList.js +++ b/components/FetchedDataSectionList.js @@ -35,13 +35,6 @@ export default class FetchedDataSectionList extends React.Component { + () => { this.onScreenFocus(); } ); this.willBlurSubscription = this.props.navigation.addListener( 'willBlur', - payload => { + () => { this.onScreenBlur(); } ); @@ -136,7 +135,7 @@ export default class FetchedDataSectionList extends React.Component { + .catch(() => { this.setState({ fetchedData: {}, refreshing: false, diff --git a/components/Sidebar.js b/components/Sidebar.js index 09216e5..2edcc0c 100644 --- a/components/Sidebar.js +++ b/components/Sidebar.js @@ -2,12 +2,11 @@ import * as React from 'react'; import {Dimensions, FlatList, Image, Linking, Platform, StyleSheet} from 'react-native'; -import {Badge, Container, Content, Left, ListItem, Right, Text} from "native-base"; +import {Badge, Container, Left, ListItem, Right, Text} from "native-base"; import i18n from "i18n-js"; import CustomMaterialIcon from '../components/CustomMaterialIcon'; import ThemeManager from "../utils/ThemeManager"; -const deviceHeight = Dimensions.get("window").height; const deviceWidth = Dimensions.get("window").width; const drawerCover = require("../assets/drawer-cover.png"); diff --git a/components/WebViewScreen.js b/components/WebViewScreen.js index e68561f..480c425 100644 --- a/components/WebViewScreen.js +++ b/components/WebViewScreen.js @@ -2,13 +2,12 @@ import * as React from 'react'; import {Linking, Platform, View} from 'react-native'; -import {Spinner, Footer, Right, Left, Body, Tab, TabHeading, Text, Tabs} from 'native-base'; +import {Body, Footer, Left, Right, Spinner, Tab, TabHeading, Tabs, Text} from 'native-base'; import WebView from "react-native-webview"; import Touchable from "react-native-platform-touchable"; import CustomMaterialIcon from "../components/CustomMaterialIcon"; import ThemeManager from "../utils/ThemeManager"; import BaseContainer from "../components/BaseContainer"; -import {NavigationActions} from 'react-navigation'; type Props = { navigation: Object, @@ -153,7 +152,7 @@ export default class WebViewScreen extends React.Component { elevation: 0, // Fix for android shadow }} locked={true} - style = {{ + style={{ backgroundColor: Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().tabDefaultBg : ThemeManager.getCurrentThemeVariables().brandPrimary diff --git a/navigation/AppNavigator.js b/navigation/AppNavigator.js index 6a89682..c3d2426 100644 --- a/navigation/AppNavigator.js +++ b/navigation/AppNavigator.js @@ -52,4 +52,5 @@ function createAppContainerWithInitialRoute(initialRoute: string) { }) ); } + export {createAppContainerWithInitialRoute}; diff --git a/navigation/MainDrawerNavigator.js b/navigation/MainDrawerNavigator.js deleted file mode 100644 index a2f291a..0000000 --- a/navigation/MainDrawerNavigator.js +++ /dev/null @@ -1,34 +0,0 @@ -// @flow - -import * as React from 'react'; -import {createDrawerNavigator} from 'react-navigation'; - -import HomeScreen from '../screens/HomeScreen'; -import PlanningScreen from '../screens/PlanningScreen'; -import ProxiwashScreen from '../screens/Proxiwash/ProxiwashScreen'; -import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen'; -import PlanexScreen from '../screens/Websites/PlanexScreen'; -import SettingsScreen from '../screens/SettingsScreen'; -import AboutScreen from '../screens/About/AboutScreen'; -import Sidebar from "../components/Sidebar"; - -/** - * Creates the drawer navigation stack - */ -export default createDrawerNavigator({ - Home: {screen: HomeScreen}, - Planning: {screen: PlanningScreen,}, - Proxiwash: {screen: ProxiwashScreen,}, - Proximo: {screen: ProximoMainScreen,}, - Planex: {screen: PlanexScreen}, - Settings: {screen: SettingsScreen,}, - About: {screen: AboutScreen,}, - }, { - contentComponent: Sidebar, - initialRouteName: 'Home', - backBehavior: 'initialRoute', - drawerType: 'front', - useNativeAnimations: true, - } -); - diff --git a/navigation/MainTabNavigator.js b/navigation/MainTabNavigator.js index 5bfa445..cb0348c 100644 --- a/navigation/MainTabNavigator.js +++ b/navigation/MainTabNavigator.js @@ -8,7 +8,6 @@ import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen'; import PlanexScreen from '../screens/Websites/PlanexScreen'; import CustomMaterialIcon from "../components/CustomMaterialIcon"; import ThemeManager from "../utils/ThemeManager"; -import AsyncStorageManager from "../utils/AsyncStorageManager"; const TAB_ICONS = { Home: 'triangle', diff --git a/package.json b/package.json index e9e01c3..ddfdff3 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,6 @@ "eject": "expo eject" }, "dependencies": { - "@expo/vector-icons": "^10.0.0", - "@react-native-community/status-bar": "^1.0.3", "expo": "^36.0.0", "expo-font": "~8.0.0", "expo-linear-gradient": "~8.0.0", @@ -27,8 +25,10 @@ "react-native-gesture-handler": "~1.5.0", "react-native-material-menu": "^0.6.7", "react-native-modalize": "^1.3.6", + "react-native-paper": "^3.5.1", "react-native-platform-touchable": "^1.1.1", "react-native-render-html": "^4.1.2", + "react-native-screens": "2.0.0-alpha.12", "react-native-side-menu": "^1.1.3", "react-native-status-bar-height": "^2.3.1", "react-native-webview": "7.4.3", diff --git a/screens/About/AboutDependenciesScreen.js b/screens/About/AboutDependenciesScreen.js index 93f5435..7a28866 100644 --- a/screens/About/AboutDependenciesScreen.js +++ b/screens/About/AboutDependenciesScreen.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import {Body, Container, Content, ListItem, Text} from 'native-base'; +import {Body, Container, ListItem, Text} from 'native-base'; import CustomHeader from "../../components/CustomHeader"; import {FlatList} from "react-native"; import i18n from "i18n-js"; diff --git a/screens/About/AboutScreen.js b/screens/About/AboutScreen.js index 6ffafb8..5cecf0e 100644 --- a/screens/About/AboutScreen.js +++ b/screens/About/AboutScreen.js @@ -2,7 +2,7 @@ import * as React from 'react'; import {FlatList, Linking, Platform, View} from 'react-native'; -import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail, Button} from 'native-base'; +import {Body, Button, Card, CardItem, Container, H1, Left, Right, Text, Thumbnail} from 'native-base'; import CustomHeader from "../../components/CustomHeader"; import i18n from "i18n-js"; import appJson from '../../app'; @@ -70,12 +70,6 @@ export default class AboutScreen extends React.Component { state = { isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1' }; - - constructor(props: any) { - super(props); - this.modalRef = React.createRef(); - } - /** * Data to be displayed in the app card */ @@ -118,7 +112,6 @@ export default class AboutScreen extends React.Component { showOnlyDebug: true }, ]; - /** * Data to be displayed in the author card */ @@ -142,7 +135,6 @@ export default class AboutScreen extends React.Component { showChevron: true }, ]; - /** * Data to be displayed in the additional developer card */ @@ -166,7 +158,6 @@ export default class AboutScreen extends React.Component { showChevron: true }, ]; - /** * Data to be displayed in the technologies card */ @@ -184,7 +175,6 @@ export default class AboutScreen extends React.Component { showChevron: true }, ]; - dataOrder: Array = [ { id: 'app', @@ -197,6 +187,11 @@ export default class AboutScreen extends React.Component { }, ]; + constructor(props: any) { + super(props); + this.modalRef = React.createRef(); + } + getAppCard() { return ( diff --git a/screens/DebugScreen.js b/screens/DebugScreen.js index f5c1347..fd7c391 100644 --- a/screens/DebugScreen.js +++ b/screens/DebugScreen.js @@ -3,29 +3,28 @@ import * as React from 'react'; import { Body, + Button, Card, CardItem, Container, Content, + Form, H1, H3, + Input, + Item, + Label, Left, List, ListItem, Right, - Text, - Form, - Item, - Label, - Input, - Button + Text } from "native-base"; import CustomHeader from "../components/CustomHeader"; import ThemeManager from '../utils/ThemeManager'; import i18n from "i18n-js"; import CustomMaterialIcon from "../components/CustomMaterialIcon"; -import Touchable from "react-native-platform-touchable"; -import {Alert, View, Clipboard, Image} from "react-native"; +import {Alert, Clipboard, View} from "react-native"; import AsyncStorageManager from "../utils/AsyncStorageManager"; import NotificationsManager from "../utils/NotificationsManager"; import {Modalize} from "react-native-modalize"; @@ -46,36 +45,16 @@ export default class DebugScreen extends React.Component { modalRef: { current: null | Modalize }; modalInputValue = ''; - - constructor(props: any) { - super(props); - this.modalRef = React.createRef(); - } - state = { modalCurrentDisplayItem: {}, currentPreferences: JSON.parse(JSON.stringify(AsyncStorageManager.getInstance().preferences)) }; - alertCurrentExpoToken() { - let token = AsyncStorageManager.getInstance().preferences.expoToken.current; - console.log(token); - Alert.alert( - 'Expo Token', - token, - [ - {text: 'Copy', onPress: () => Clipboard.setString(token)}, - {text: 'OK'} - ] - ); + constructor(props: any) { + super(props); + this.modalRef = React.createRef(); } - async forceExpoTokenUpdate() { - await NotificationsManager.forceExpoTokenUpdate(); - this.alertCurrentExpoToken(); - } - - static getGeneralItem(onPressCallback: Function, icon: ?string, title: string, subtitle: string) { return ( { ); } + alertCurrentExpoToken() { + let token = AsyncStorageManager.getInstance().preferences.expoToken.current; + console.log(token); + Alert.alert( + 'Expo Token', + token, + [ + {text: 'Copy', onPress: () => Clipboard.setString(token)}, + {text: 'OK'} + ] + ); + } + + async forceExpoTokenUpdate() { + await NotificationsManager.forceExpoTokenUpdate(); + this.alertCurrentExpoToken(); + } + showEditModal(item: Object) { this.setState({ modalCurrentDisplayItem: item diff --git a/screens/HomeScreen.js b/screens/HomeScreen.js index 14a1eef..5fead20 100644 --- a/screens/HomeScreen.js +++ b/screens/HomeScreen.js @@ -2,7 +2,7 @@ import * as React from 'react'; import {Image, Linking, TouchableOpacity, View} from 'react-native'; -import {Body, Button, Card, CardItem, Left, Text, Thumbnail, H1, H3} from 'native-base'; +import {Body, Button, Card, CardItem, H1, Left, Text, Thumbnail} from 'native-base'; import i18n from "i18n-js"; import CustomMaterialIcon from '../components/CustomMaterialIcon'; import FetchedDataSectionList from "../components/FetchedDataSectionList"; @@ -42,6 +42,16 @@ export default class HomeScreen extends FetchedDataSectionList { super(DATA_URL, REFRESH_TIME); } + /** + * Converts a dateString using Unix Timestamp to a formatted date + * @param dateString {string} The Unix Timestamp representation of a date + * @return {string} The formatted output date + */ + static getFormattedDate(dateString: string) { + let date = new Date(Number.parseInt(dateString) * 1000); + return date.toLocaleString(); + } + getHeaderTranslation() { return i18n.t("screens.home"); } @@ -119,17 +129,6 @@ export default class HomeScreen extends FetchedDataSectionList { return dataset } - - /** - * Converts a dateString using Unix Timestamp to a formatted date - * @param dateString {string} The Unix Timestamp representation of a date - * @return {string} The formatted output date - */ - static getFormattedDate(dateString: string) { - let date = new Date(Number.parseInt(dateString) * 1000); - return date.toLocaleString(); - } - getRenderSectionHeader(title: string) { if (title === '') { return ; @@ -294,7 +293,7 @@ export default class HomeScreen extends FetchedDataSectionList { let icon = 'calendar-range'; let color = ThemeManager.getCurrentThemeVariables().planningColor; let title = i18n.t('homeScreen.dashboard.todayEventsTitle'); - let subtitle = ''; + let subtitle; let futureEvents = this.getFutureEvents(content); let isAvailable = futureEvents.length > 0; if (isAvailable) { @@ -336,7 +335,7 @@ export default class HomeScreen extends FetchedDataSectionList { let proximoColor = ThemeManager.getCurrentThemeVariables().proximoColor; let proximoTitle = i18n.t('homeScreen.dashboard.proximoTitle'); let isProximoAvailable = parseInt(proximoData) > 0; - let proximoSubtitle = ''; + let proximoSubtitle; if (isProximoAvailable) { proximoSubtitle = @@ -358,7 +357,7 @@ export default class HomeScreen extends FetchedDataSectionList { let menuColor = ThemeManager.getCurrentThemeVariables().menuColor; let menuTitle = i18n.t('homeScreen.dashboard.menuTitle'); let isMenuAvailable = menuData.length > 0; - let menuSubtitle = ''; + let menuSubtitle; if (isMenuAvailable) { menuSubtitle = i18n.t('homeScreen.dashboard.menuSubtitle'); } else @@ -410,39 +409,39 @@ export default class HomeScreen extends FetchedDataSectionList { let availableWashers = proxiwashData['washers']; if (proxiwashIsAvailable) { proxiwashSubtitle = + + 0 ? + 'bold' : + 'normal', + color: dryerColor + }}> + {availableDryers} + - 0 ? - 'bold' : - 'normal', - color: dryerColor - }}> - {availableDryers} - - - { - availableDryers > 1 ? - i18n.t('homeScreen.dashboard.proxiwashSubtitle1Plural') : - i18n.t('homeScreen.dashboard.proxiwashSubtitle1') - } - - {"\n"} - 0 ? - 'bold' : - 'normal', - color: washerColor - }}> - {availableWashers} - - - { - availableWashers > 1 ? - i18n.t('homeScreen.dashboard.proxiwashSubtitle2Plural') : - i18n.t('homeScreen.dashboard.proxiwashSubtitle2') - } - - ; + { + availableDryers > 1 ? + i18n.t('homeScreen.dashboard.proxiwashSubtitle1Plural') : + i18n.t('homeScreen.dashboard.proxiwashSubtitle1') + } + + {"\n"} + 0 ? + 'bold' : + 'normal', + color: washerColor + }}> + {availableWashers} + + + { + availableWashers > 1 ? + i18n.t('homeScreen.dashboard.proxiwashSubtitle2Plural') : + i18n.t('homeScreen.dashboard.proxiwashSubtitle2') + } + + ; } else proxiwashSubtitle = i18n.t('homeScreen.dashboard.proxiwashSubtitleNA'); let proxiwashClickAction = () => this.props.navigation.navigate('Proxiwash'); @@ -497,10 +496,8 @@ export default class HomeScreen extends FetchedDataSectionList { getRenderItem(item: Object, section: Object, data: Object) { - if (section['id'] === SECTIONS_ID[0]) { - return this.getDashboardItem(item); - } else { - return ( + return ( + section['id'] === SECTIONS_ID[0] ? this.getDashboardItem(item) : - ); - } + ); } - } diff --git a/screens/PlanningScreen.js b/screens/PlanningScreen.js index 3d936f5..1fe69ac 100644 --- a/screens/PlanningScreen.js +++ b/screens/PlanningScreen.js @@ -1,10 +1,9 @@ // @flow import * as React from 'react'; -import {BackHandler} from 'react-native'; -import {Content, H1, H3, Text, Button} from 'native-base'; +import {BackHandler, Image, View} from 'react-native'; +import {Button, Content, H1, H3, Text} from 'native-base'; import i18n from "i18n-js"; -import {View, Image} from "react-native"; import ThemeManager from "../utils/ThemeManager"; import {Linking} from "expo"; import BaseContainer from "../components/BaseContainer"; @@ -61,6 +60,12 @@ export default class PlanningScreen extends React.Component { didFocusSubscription: Function; willBlurSubscription: Function; + state = { + modalCurrentDisplayItem: {}, + refreshing: false, + agendaItems: {}, + calendarShowing: false, + }; constructor(props: any) { super(props); @@ -68,7 +73,7 @@ export default class PlanningScreen extends React.Component { this.webDataManager = new WebDataManager(FETCH_URL); this.didFocusSubscription = props.navigation.addListener( 'didFocus', - payload => + () => BackHandler.addEventListener( 'hardwareBackPress', this.onBackButtonPressAndroid @@ -83,7 +88,7 @@ export default class PlanningScreen extends React.Component { this._onRefresh(); this.willBlurSubscription = this.props.navigation.addListener( 'willBlur', - payload => + () => BackHandler.removeEventListener( 'hardwareBackPress', this.onBackButtonPressAndroid @@ -105,13 +110,6 @@ export default class PlanningScreen extends React.Component { this.willBlurSubscription && this.willBlurSubscription.remove(); } - state = { - modalCurrentDisplayItem: {}, - refreshing: false, - agendaItems: {}, - calendarShowing: false, - }; - getCurrentDate() { let today = new Date(); return this.getFormattedDate(today); @@ -351,7 +349,7 @@ export default class PlanningScreen extends React.Component { getFormattedTime(event: Object) { if (this.getEventEndTime(event) !== "") - return this.getEventStartTime(event) + " - " + this.getEventEndTime(event) + return this.getEventStartTime(event) + " - " + this.getEventEndTime(event); else return this.getEventStartTime(event); } diff --git a/screens/Proximo/ProximoAboutScreen.js b/screens/Proximo/ProximoAboutScreen.js index 93e87f5..269a5f6 100644 --- a/screens/Proximo/ProximoAboutScreen.js +++ b/screens/Proximo/ProximoAboutScreen.js @@ -2,7 +2,7 @@ import * as React from 'react'; import {Image, Linking, View} from 'react-native'; -import {Body, Card, CardItem, Container, Content, H2, Left, Text} from 'native-base'; +import {Card, CardItem, Container, Content, H2, Left, Text} from 'native-base'; import CustomHeader from "../../components/CustomHeader"; import i18n from "i18n-js"; import CustomMaterialIcon from "../../components/CustomMaterialIcon"; @@ -11,14 +11,6 @@ type Props = { navigation: Object, }; -/** - * Opens a link in the device's browser - * @param link The link to open - */ -function openWebLink(link) { - Linking.openURL(link).catch((err) => console.error('Error opening link', err)); -} - /** * Class defining an about screen. This screen shows the user information about the app and it's author. */ diff --git a/screens/Proximo/ProximoListScreen.js b/screens/Proximo/ProximoListScreen.js index e505c76..446e17b 100644 --- a/screens/Proximo/ProximoListScreen.js +++ b/screens/Proximo/ProximoListScreen.js @@ -1,9 +1,9 @@ // @flow import * as React from 'react'; -import {Body, Container, Content, Left, ListItem, Right, Text, Thumbnail, H1, H3} from 'native-base'; +import {Body, Container, Content, H1, H3, Left, ListItem, Right, Text, Thumbnail} from 'native-base'; import CustomHeader from "../../components/CustomHeader"; -import {FlatList, Platform, View, Image} from "react-native"; +import {FlatList, Image, Platform, View} from "react-native"; import Touchable from 'react-native-platform-touchable'; import Menu, {MenuItem} from 'react-native-material-menu'; import i18n from "i18n-js"; @@ -62,13 +62,6 @@ export default class ProximoListScreen extends React.Component { originalData: Array; navData = this.props.navigation.getParam('data', []); shouldFocusSearchBar = this.props.navigation.getParam('shouldFocusSearchBar', false); - - constructor(props: any) { - super(props); - this.modalRef = React.createRef(); - this.originalData = this.navData['data']; - } - state = { currentlyDisplayedData: this.navData['data'].sort(sortPrice), currentSortMode: sortMode.price, @@ -77,9 +70,14 @@ export default class ProximoListScreen extends React.Component { sortNameIcon: '', modalCurrentDisplayItem: {}, }; - _menu: Menu; + constructor(props: any) { + super(props); + this.modalRef = React.createRef(); + this.originalData = this.navData['data']; + } + /** * Saves the reference to the sort menu for later use * @@ -132,9 +130,6 @@ export default class ProximoListScreen extends React.Component { } break; } - this.setState({ - navData: data, - }); this.setupSortIcons(mode, isReverse); this._menu.hide(); } @@ -297,7 +292,6 @@ export default class ProximoListScreen extends React.Component { render() { const nav = this.props.navigation; - const navType = nav.getParam('type', '{name: "Error"}'); return ( console.error('Error opening link', err)); -} - /** * Class defining an about screen. This screen shows the user information about the app and it's author. */ diff --git a/screens/Proxiwash/ProxiwashScreen.js b/screens/Proxiwash/ProxiwashScreen.js index 310ed70..fece8ab 100644 --- a/screens/Proxiwash/ProxiwashScreen.js +++ b/screens/Proxiwash/ProxiwashScreen.js @@ -89,7 +89,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList { this.setState({machinesWatched: fetchedList}) }); // Get updated watchlist after received notification - Expo.Notifications.addListener((notification) => { + Expo.Notifications.addListener(() => { NotificationsManager.getMachineNotificationWatchlist((fetchedList) => { this.setState({machinesWatched: fetchedList}) }); diff --git a/screens/SelfMenuScreen.js b/screens/SelfMenuScreen.js index 76bb27b..3221b3b 100644 --- a/screens/SelfMenuScreen.js +++ b/screens/SelfMenuScreen.js @@ -2,11 +2,10 @@ import * as React from 'react'; import {View} from 'react-native'; -import {Text, H2, H3, Card, CardItem} from 'native-base'; +import {Card, CardItem, H2, H3, Text} from 'native-base'; import ThemeManager from "../utils/ThemeManager"; import i18n from "i18n-js"; import FetchedDataSectionList from "../components/FetchedDataSectionList"; -import LocaleManager from "../utils/LocaleManager"; const DATA_URL = "https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/menu/menu_data.json"; @@ -64,7 +63,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList { return true; } - hasSideMenu() : boolean { + hasSideMenu(): boolean { return false; } @@ -150,7 +149,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList { flexDirection: 'column', paddingTop: 0, }}> - {item.dishes.map((object, i) => + {item.dishes.map((object) => {object.name !== "" ? { startScreenPickerSelected: AsyncStorageManager.getInstance().preferences.defaultStartScreen.current, }; + /** + * Get a list item using the specified control + * + * @param control The custom control to use + * @param icon The icon name to display on the list item + * @param title The text to display as this list item title + * @param subtitle The text to display as this list item subtitle + * @returns {React.Node} + */ + static getGeneralItem(control: React.Node, icon: string, title: string, subtitle: string) { + return ( + + + + + + + {title} + + + {subtitle} + + + + + {control} + + + ); + } + /** * Save the value for the proxiwash reminder notification time * @@ -179,39 +210,6 @@ export default class SettingsScreen extends React.Component { ); } - /** - * Get a list item using the specified control - * - * @param control The custom control to use - * @param icon The icon name to display on the list item - * @param title The text to display as this list item title - * @param subtitle The text to display as this list item subtitle - * @returns {React.Node} - */ - static getGeneralItem(control: React.Node, icon: string, title: string, subtitle: string) { - return ( - - - - - - - {title} - - - {subtitle} - - - - - {control} - - - ); - } - render() { const nav = this.props.navigation; return ( diff --git a/screens/Websites/AmicaleScreen.js b/screens/Websites/AmicaleScreen.js index 38b5bfc..57a863a 100644 --- a/screens/Websites/AmicaleScreen.js +++ b/screens/Websites/AmicaleScreen.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; type Props = { diff --git a/screens/Websites/BlueMindScreen.js b/screens/Websites/BlueMindScreen.js index afcabaa..781e33f 100644 --- a/screens/Websites/BlueMindScreen.js +++ b/screens/Websites/BlueMindScreen.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; import i18n from "i18n-js"; diff --git a/screens/Websites/ElusEtudScreen.js b/screens/Websites/ElusEtudScreen.js index 1151851..7da2dc9 100644 --- a/screens/Websites/ElusEtudScreen.js +++ b/screens/Websites/ElusEtudScreen.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; type Props = { diff --git a/screens/Websites/EntScreen.js b/screens/Websites/EntScreen.js index 8df8e49..bb0f300 100644 --- a/screens/Websites/EntScreen.js +++ b/screens/Websites/EntScreen.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; import i18n from "i18n-js"; @@ -50,7 +49,7 @@ export default class EntScreen extends React.Component { 'let stylesheet = document.createElement(\'link\');\n' + 'stylesheet.type = \'text/css\';\n' + 'stylesheet.rel = \'stylesheet\';\n' + - 'stylesheet.href = \'' + CUSTOM_CSS_GENERAL +'\';\n' + + 'stylesheet.href = \'' + CUSTOM_CSS_GENERAL + '\';\n' + 'let mobileSpec = document.createElement(\'meta\');\n' + 'mobileSpec.name = \'viewport\';\n' + 'mobileSpec.content = \'width=device-width, initial-scale=1.0\';\n' + diff --git a/screens/Websites/PlanexScreen.js b/screens/Websites/PlanexScreen.js index 521977b..ccdf9e0 100644 --- a/screens/Websites/PlanexScreen.js +++ b/screens/Websites/PlanexScreen.js @@ -3,7 +3,6 @@ import * as React from 'react'; import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; -import i18n from "i18n-js"; type Props = { navigation: Object, diff --git a/screens/Websites/TutorInsaScreen.js b/screens/Websites/TutorInsaScreen.js index 53c2101..c0bef99 100644 --- a/screens/Websites/TutorInsaScreen.js +++ b/screens/Websites/TutorInsaScreen.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; type Props = { diff --git a/screens/Websites/WiketudScreen.js b/screens/Websites/WiketudScreen.js index 98353b0..8a8e23e 100644 --- a/screens/Websites/WiketudScreen.js +++ b/screens/Websites/WiketudScreen.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import ThemeManager from "../../utils/ThemeManager"; import WebViewScreen from "../../components/WebViewScreen"; type Props = {