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 (