From c14714f16f1a4683b3b640845e6386ab4c6fbf5e Mon Sep 17 00:00:00 2001 From: pranavpandey1998official <44601530+pranavpandey1998official@users.noreply.github.com> Date: Tue, 11 Jun 2019 19:31:40 +0530 Subject: [PATCH] [NEW] Settings view (#900) * new settings view * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * fix eslint * eslint fixed all bugs and setup on my device * move version from sidebar to settingsView * add server Version not hard coded * goto root stack after change language * support RTL * fix the ui of last section * fixed bugs done requested changes * added actions for contact us and license * done requested changes * removed verticle scroll indicator * removed default export of device info * fixed separator styling * refactor Items in settings view * changed language view * change activeOpacity * done requested changes * fixed lint * changed layout * added test * fix bug * fix bug * added e2e tests * undone unnessary changes * undone unnessary changes * removed firebase * Comment slash e2e tests * Refactor Settings * Refactor LanguageView * Separator * Unified styles * fix indentation --- __mocks__/reactotron-react-native.js | 3 + app/containers/DisclosureIndicator.js | 5 +- app/containers/ListItem.js | 93 ++++++ app/containers/Separator.js | 21 ++ app/i18n/locales/en.js | 11 +- app/index.js | 4 +- app/utils/deviceInfo.js | 9 +- app/views/LanguageView/index.js | 158 +++++++++ app/views/SettingsView/index.js | 314 +++++++----------- app/views/SettingsView/styles.js | 12 + app/views/SidebarView/index.js | 4 - app/views/Styles.js | 16 +- e2e/08-room.spec.js | 46 +-- e2e/14-setting.spec.js | 94 ++++++ ...room.spec.js => 15-joinpublicroom.spec.js} | 0 15 files changed, 556 insertions(+), 234 deletions(-) create mode 100644 __mocks__/reactotron-react-native.js create mode 100644 app/containers/ListItem.js create mode 100644 app/containers/Separator.js create mode 100644 app/views/LanguageView/index.js create mode 100644 app/views/SettingsView/styles.js create mode 100644 e2e/14-setting.spec.js rename e2e/{14-joinpublicroom.spec.js => 15-joinpublicroom.spec.js} (100%) diff --git a/__mocks__/reactotron-react-native.js b/__mocks__/reactotron-react-native.js new file mode 100644 index 000000000..9180fdfe5 --- /dev/null +++ b/__mocks__/reactotron-react-native.js @@ -0,0 +1,3 @@ +export default { + createSagaMonitor: () => {} +}; diff --git a/app/containers/DisclosureIndicator.js b/app/containers/DisclosureIndicator.js index 03bed9861..25a284baf 100644 --- a/app/containers/DisclosureIndicator.js +++ b/app/containers/DisclosureIndicator.js @@ -14,9 +14,12 @@ const styles = StyleSheet.create({ } }); +export const DisclosureImage = React.memo(() => ); + const DisclosureIndicator = React.memo(() => ( - + )); + export default DisclosureIndicator; diff --git a/app/containers/ListItem.js b/app/containers/ListItem.js new file mode 100644 index 000000000..069329343 --- /dev/null +++ b/app/containers/ListItem.js @@ -0,0 +1,93 @@ +import React from 'react'; +import { View, Text, StyleSheet } from 'react-native'; +import PropTypes from 'prop-types'; +import { RectButton } from 'react-native-gesture-handler'; + +import { COLOR_TEXT } from '../constants/colors'; +import sharedStyles from '../views/Styles'; + +const styles = StyleSheet.create({ + container: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + height: 56, + paddingHorizontal: 15 + }, + disabled: { + opacity: 0.3 + }, + textContainer: { + flex: 1, + justifyContent: 'center' + }, + title: { + fontSize: 16, + ...sharedStyles.textColorNormal, + ...sharedStyles.textRegular + }, + subtitle: { + fontSize: 14, + ...sharedStyles.textColorNormal, + ...sharedStyles.textRegular + } +}); + +const Content = React.memo(({ + title, subtitle, disabled, testID, right +}) => ( + + + {title} + {subtitle + ? {subtitle} + : null + } + + {right ? right() : null} + +)); + +const Button = React.memo(({ + onPress, ...props +}) => ( + + + +)); + +const Item = React.memo(({ ...props }) => { + if (props.onPress) { + return