From f828b5dc29d0f9bbc18a97ca9afacdaaa788c311 Mon Sep 17 00:00:00 2001 From: nileshbhingaradiya Date: Fri, 17 Sep 2021 13:54:59 +0530 Subject: [PATCH] 16 Add timezone / date format option in 'Settings' area --- .editorconfig | 25 ++ .prettierrc.js | 1 + App.js | 480 +++++++++++---------- components/PlayerError.js | 22 +- components/ToggleNavigationButton.js | 14 +- ios/Podfile.lock | 612 ++++++++++++++------------- lib/api.js | 233 +++++----- lib/notification.js | 26 +- lib/storage.js | 166 ++++---- lib/util.js | 91 ++-- notification.js | 99 +++-- package.json | 4 + screens/CameraScreen.js | 544 ++++++++++++++++-------- screens/ConnectServerScreen.js | 165 ++++---- screens/EventScreen.js | 96 ++--- screens/ServerSettingsScreen.js | 554 ++++++++++++++---------- screens/SettingsScreen.js | 184 ++++++++ state.js | 48 ++- stylesheet.js | 23 +- yarn.lock | 34 +- 20 files changed, 1997 insertions(+), 1424 deletions(-) create mode 100644 .editorconfig create mode 100644 screens/SettingsScreen.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8bde8ad --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# http://editorconfig.org +root = true +[*] +# Change these settings to your own preference +indent_style = space +indent_size = 2 +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +# editorconfig-tools is unable to ignore longs strings or urls +max_line_length = 120 + + +[*.md] +max_line_length = 0 +trim_trailing_whitespace = false + + +# Use tabs for indentation (Makefiles require tabs) +indent_style = tab + diff --git a/.prettierrc.js b/.prettierrc.js index 5c4de1a..a9c3800 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -3,4 +3,5 @@ module.exports = { jsxBracketSameLine: true, singleQuote: true, trailingComma: 'all', + printWidth: 120, }; diff --git a/App.js b/App.js index 956056c..4c1f1af 100644 --- a/App.js +++ b/App.js @@ -6,7 +6,6 @@ * @flow strict-local */ - import 'react-native-gesture-handler'; import SplashScreen from 'react-native-splash-screen'; @@ -15,16 +14,15 @@ import messaging from '@react-native-firebase/messaging'; import React, {useEffect, useReducer, useRef, useCallback, useState} from 'react'; import {NavigationContainer, DarkTheme, useTheme} from '@react-navigation/native'; -import { createStackNavigator } from '@react-navigation/stack'; -import { createDrawerNavigator} from '@react-navigation/drawer'; +import {createStackNavigator} from '@react-navigation/stack'; +import {createDrawerNavigator} from '@react-navigation/drawer'; import Orientation from 'react-native-orientation-locker'; import Toast from 'react-native-toast-message'; -import styles from './stylesheet'; - import ConnectServerScreen from './screens/ConnectServerScreen'; import ServerSettingsScreen from './screens/ServerSettingsScreen'; +import SettingsScreen from './screens/SettingsScreen'; import SessionContext from './session-context'; import {CameraScreen, DirectCameraScreen} from './screens/CameraScreen'; @@ -32,14 +30,14 @@ import EventScreen from './screens/EventScreen'; import DrawerMenu from './menu'; import {Button, View, Alert, Text, Platform} from 'react-native'; -import { MenuProvider } from 'react-native-popup-menu'; +import {MenuProvider} from 'react-native-popup-menu'; import { - getAccountInfoList, - getActiveAccountInfoByList, - getTargetAccountByServerId, - removeAccountInfo, - getSelectedCameraList + getAccountInfoList, + getActiveAccountInfoByList, + getTargetAccountByServerId, + removeAccountInfo, + getSelectedCameraList, } from './lib/storage'; const Stack = createStackNavigator(); @@ -52,220 +50,266 @@ import {handleNotification, isValidNotificationType} from './notification'; import {initialState, reducer} from './state'; function ServerRemoveButton({id, name, serverUuid, address, port, navigation, updateAccountList}) { - return (