diff --git a/src/Router.js b/src/Router.js index 69391f2..cd6ade3 100644 --- a/src/Router.js +++ b/src/Router.js @@ -32,12 +32,6 @@ import ScanGenericQRCode from '@src/screens/ScanGenericQRCode'; import CustomFlashMessage from '@src/components/organisms/CustomFlashMessage'; import { showMessage } from 'react-native-flash-message'; import LinkedKeysDetails from '@src/screens/LinkedKeysDetails'; -import Welcome from '@src/screens/PostLaunchOptIn/Welcome'; -import OptInAccountDetails from '@src/screens/PostLaunchOptIn/OptInAccountDetails'; -import OptInSelectSymbolAccount from '@src/screens/PostLaunchOptIn/OptInSelectSymbolAccount'; -import OptInReview from '@src/screens/PostLaunchOptIn/OptInReview'; -import NIS1AccountDetails from '@src/screens/PostLaunchOptIn/NIS1AccountDetails'; -import OptInSelectSymbolMultisigDestination from '@src/screens/PostLaunchOptIn/OptInSelectSymbolMultisigDestination'; export const BASE_SCREEN_NAME = 'com.nemgroup.wallet'; export const CUSTOM_FLASH_MESSAGE = `${BASE_SCREEN_NAME}.CUSTOM_FLASH_MESSAGE`; @@ -70,12 +64,6 @@ export const ACCOUNT_DETAILS_SCREEN = `${BASE_SCREEN_NAME}.ACCOUNT_DETAILS_SCREE export const CREATE_ACCOUNT_SCREEN = `${BASE_SCREEN_NAME}.CREATE_ACCOUNT_SCREEN`; export const QR_SCANNER_SCREEN = `${BASE_SCREEN_NAME}.QR_SCANNER_SCREEN`; export const SHOW_LINKED_KEYS_SCREEN = `${BASE_SCREEN_NAME}.SHOW_LINKED_KEYS_SCREEN`; -export const OPTIN_WELCOME = `${BASE_SCREEN_NAME}.OPTIN_WELCOME`; -export const OPTIN_ACCOUNT_DETAIL = `${BASE_SCREEN_NAME}.OPTIN_ACCOUNT_DETAIL`; -export const OPTIN_SYMBOL_ACCOUNT = `${BASE_SCREEN_NAME}.OPTIN_SYMBOL_ACCOUNT`; -export const OPTIN_FINISH = `${BASE_SCREEN_NAME}.OPTIN_FINISH`; -export const NIS1_ACCOUNT_DETAILS = `${BASE_SCREEN_NAME}.NIS1_ACCOUNT_DETAILS`; -export const OPTIN_SELECT_MULTISIG_DESTINATION = `${BASE_SCREEN_NAME}.OPTIN_SELECT_MULTISIG_DESTINATION`; interface MessageProps { message: string; @@ -115,12 +103,6 @@ export class Router { [CONTACT_PROFILE_SCREEN, ContactProfile], [QR_SCANNER_SCREEN, QRScanner], [SHOW_LINKED_KEYS_SCREEN, LinkedKeysDetails], - [OPTIN_WELCOME, Welcome], - [OPTIN_ACCOUNT_DETAIL, OptInAccountDetails], - [OPTIN_SYMBOL_ACCOUNT, OptInSelectSymbolAccount], - [OPTIN_FINISH, OptInReview], - [NIS1_ACCOUNT_DETAILS, NIS1AccountDetails], - [OPTIN_SELECT_MULTISIG_DESTINATION, OptInSelectSymbolMultisigDestination], ]; static registerScreens() { @@ -218,24 +200,6 @@ export class Router { static goToShowLinkedKeys(passProps, parentComponent?) { return Router.goToScreen(SHOW_LINKED_KEYS_SCREEN, passProps, parentComponent); } - static goToOptInWelcome(passProps, parentComponent?) { - return Router.goToScreen(OPTIN_WELCOME, passProps, parentComponent); - } - static goToOptInAccountDetails(passProps, parentComponent?) { - return Router.goToScreen(OPTIN_ACCOUNT_DETAIL, passProps, parentComponent); - } - static goToOptInSelectSymbolAccount(passProps, parentComponent?) { - return Router.goToScreen(OPTIN_SYMBOL_ACCOUNT, passProps, parentComponent); - } - static goToOptInFinish(passProps, parentComponent?) { - return Router.goToScreen(OPTIN_FINISH, passProps, parentComponent); - } - static goToNIS1AccountDetails(passProps, parentComponent?) { - return Router.goToScreen(NIS1_ACCOUNT_DETAILS, passProps, parentComponent); - } - static goToOptinSelectSymbolMultisigDestination(passProps, parentComponent?) { - return Router.goToScreen(OPTIN_SELECT_MULTISIG_DESTINATION, passProps, parentComponent); - } static goToScreen(screen: string, passProps, parentComponent?) { setDefaultNavOptions(); diff --git a/src/components/atoms/BottomModal/BottomModal.js b/src/components/atoms/BottomModal/BottomModal.js deleted file mode 100644 index b8aa590..0000000 --- a/src/components/atoms/BottomModal/BottomModal.js +++ /dev/null @@ -1,24 +0,0 @@ -import React, { Component } from 'react'; -import { Modal, View } from 'react-native'; -import styles from './BottomModal.styl'; -import Card from '@src/components/atoms/Card'; - -type Props = { - isModalOpen: boolean, - onClose: () => {}, -}; - -export default class BottomModal extends Component { - render() { - const { isModalOpen, onClose, children } = this.props; - - return ( - - - - {children} - - - ); - } -} diff --git a/src/components/atoms/BottomModal/BottomModal.styl b/src/components/atoms/BottomModal/BottomModal.styl deleted file mode 100644 index a39234e..0000000 --- a/src/components/atoms/BottomModal/BottomModal.styl +++ /dev/null @@ -1,23 +0,0 @@ -.bottomCardWrapper { - flex: 1; - flex-direction: column; - justify-content: flex-end; - align-items: center; -} - -.modalOverlay { - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; -} - -.bottomCard { - min-height: 300px; - padding: 20px 0px 28px; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - flex: 0.6; - width: 100%; -} diff --git a/src/components/atoms/CompoundButton/compoundbutton.styl b/src/components/atoms/CompoundButton/compoundbutton.styl deleted file mode 100644 index 2e71d22..0000000 --- a/src/components/atoms/CompoundButton/compoundbutton.styl +++ /dev/null @@ -1,93 +0,0 @@ -.wrapper { - overflow: hidden; - flex-direction: row; - justify-content: space-around; - //background-color: #f005; -} - -.buttonContainer { - flex-direction: column; - align-items: center; - //background-color: #00f5; -} - -.buttonGroup { - width: 60px; - height: 60px; - border-radius: 30px; - //background-color: #0f05; -} - -.button { - border-radius: 28px; - padding-top: 6px; - padding-bottom: 6px; - padding-left: 4px; - padding-right: 4px; - flex: 1; - width: 100%; - opacity: 0.6; - justify-content: center; - - &__disabled { - elevation: 0px; - background-color: #30B4B5; - } -} - -.gradient { - &__start { - x: 0; - y: 0; - } - - &__end { - x: 1; - y: 0; - } - - &__colors { - start: #d7caf0; - center: #eeedf4; - end: #f3f4f8; - } -} - -.text { - font-size: 12px; - //font-family: 'NotoSans-Bold'; - //background-color: #0f05; - color: #ffffff; - text-align: center; - padding: 12px; - //text-transform: uppercase; - line-height: 12px; - max-width: 120px; - - &__disabled { - color: #CDCDCD; - } -} - -.loading { - padding: 12px; -} - -.icon { - max-width: 16px; - max-height: 16px; - resize-mode: contain; -} - -.buttonContent { - flex-direction: row; - justify-content: center; - align-items: center; - flex: 1; -} - -.divider { - background-color: #ffffff; - width: 1px; - align-self: stretch; -} \ No newline at end of file diff --git a/src/components/atoms/CompoundButton/index.js b/src/components/atoms/CompoundButton/index.js deleted file mode 100644 index ce706bd..0000000 --- a/src/components/atoms/CompoundButton/index.js +++ /dev/null @@ -1,164 +0,0 @@ -/** - * @format - * @flow - */ - -import React from 'react'; -import { ActivityIndicator, Image, Platform, Text, TouchableNativeFeedback, TouchableOpacity, View } from 'react-native'; -import LinearGradient from 'react-native-linear-gradient'; - -import styles from './compoundbutton.styl'; - -type Props = { - titleLeft: string, - titleRight: string, - loading?: boolean, - accessibilityLabelLeft?: string, - accessibilityLabelRight?: string, - disabled?: boolean, - onPressLeft?: () => void, - onPressRight?: () => void, - testIDLeft?: string, - testIDRight?: string, - style?: [], - iconLeft?: any, - iconRight?: any, -}; - -const CompoundButton = (props: Props) => { - const { - titleLeft, - titleRight, - loading, - accessibilityLabelLeft, - accessibilityLabelRight, - disabled, - onPressLeft, - onPressRight, - style, - iconLeft, - iconRight, - testIDLeft, - testIDRight, - } = props; - const buttonStyles = [styles.button]; - const { gradient__colors: gradientColorsObj, gradient__start: gradientStart, gradient__end: gradientEnd } = styles; - const gradientColors = [gradientColorsObj.start, gradientColorsObj.end]; - const textStyles = [styles.text]; - - const accessibilityTraits = ['button']; - - if (disabled) { - buttonStyles.push(styles.button__disabled); - textStyles.push(styles.text__disabled); - accessibilityTraits.push('disabled'); - } - - let Touchable; - let otherNativeProps = null; - if (Platform.OS === 'android' && Platform.Version >= 21) { - Touchable = TouchableNativeFeedback; - otherNativeProps = { useForeground: true }; - } else { - Touchable = TouchableOpacity; - otherNativeProps = { activeOpacity: 0.6 }; - } - - return ( - - - - {/* $FlowFixMe :useForeground props not available for TouchableOpacity */} - - {loading ? ( - - ) : ( - - - - )} - - - - {titleLeft} - - - - {/* $FlowFixMe :useForeground props not available for TouchableOpacity */} - - {loading ? ( - - ) : ( - - - - )} - - - {titleRight} - - - ); -}; - -CompoundButton.defaultProps = { - accessibilityLabelLeft: '', - accessibilityLabelRight: '', - disabled: false, - onPressLeft: () => {}, - onPressRight: () => {}, - testIDLeft: '', - testIDRight: '', - style: [], - iconLeft: null, - iconRight: null, - loading: false, -}; - -export default CompoundButton; diff --git a/src/components/controls/Image.js b/src/components/controls/Image.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/old/StepViewTitleBar/index.js b/src/components/old/StepViewTitleBar/index.js deleted file mode 100644 index 29f5ad5..0000000 --- a/src/components/old/StepViewTitleBar/index.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * @format - * @flow - */ - -import React from 'react'; -import { Image, Text, TouchableOpacity, View } from 'react-native'; -import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet'; -import type { ElementProps } from 'react'; -import GlobalStyles from '@src/styles/GlobalStyles'; - -import styles from './titlebar.styl'; - -export type titleTheme = { - textColor: string, - backIconRes: string, - closeIconRes: string, -}; - -const lightTheme: titleTheme = { - textColor: GlobalStyles.color.onLight.TITLE, - backIconRes: require('@src/assets/icons/ic-back-black.png'), - closeIconRes: require('@src/assets/icons/close_light.png'), -}; - -const darkTheme: titleTheme = { - textColor: GlobalStyles.color.onDark.TITLE, - backIconRes: require('@src/assets/icons/ic-back-white.png'), - closeIconRes: require('@src/assets/icons/close_dark.png'), -}; - -const themeMap = new Map(); -themeMap.set('light', lightTheme); -themeMap.set('dark', darkTheme); - -type Props = { - ...ElementProps, - title?: ?string, - theme?: 'light' | 'dark', - showBack?: boolean, - showClose?: boolean, - titleTextStyle?: ViewStyleProp, - onBack?: () => ?boolean, - onClose?: () => ?boolean, - alignLeft: boolean, -}; - -const generateIconButton = ( - testID: string, - touchableStyle: View.propTypes.style, - iconRes: string, - iconStyle: View.propTypes.style, - onPress: () => void -) => { - return ( - - - - ); -}; - -function TitleBar(props: Props) { - const { title, children, titleTextStyle, showBack, onBack, showClose, onClose, style, theme, alignLeft } = props; - - const barTheme: titleTheme = themeMap.get(theme) || lightTheme; - - let backButton = null; - if (showBack) { - backButton = generateIconButton('back-button', styles.leftIconContainer, barTheme.backIconRes, styles.icon, onBack); - } - - let closeButton = null; - if (showClose) { - closeButton = generateIconButton('close-button', styles.rightIconContainer, barTheme.closeIconRes, styles.icon, onClose); - } - - let titleBarContent = children; - // Show title only if there are no children - if (titleBarContent === undefined || titleBarContent === null) { - const titleStyle = { color: barTheme.textColor, ...titleTextStyle }; - titleBarContent = ( - - {title} - - ); - } - - return ( - - {backButton} - {titleBarContent} - {closeButton} - - ); -} - -TitleBar.defaultProps = { - title: null, - theme: 'light', - showBack: false, - showClose: false, - titleTextStyle: null, - onBack: () => {}, - onClose: () => {}, -}; - -export default TitleBar; diff --git a/src/components/old/StepViewTitleBar/titlebar.styl b/src/components/old/StepViewTitleBar/titlebar.styl deleted file mode 100644 index 931691b..0000000 --- a/src/components/old/StepViewTitleBar/titlebar.styl +++ /dev/null @@ -1,40 +0,0 @@ -.titleBarContainer { - padding: 10px; - padding-top: 0; - align-items: center; - justify-content: center; - width: 100%; -} - -.iconContainer { - position: absolute; - top: -8px; - bottom: 0px; - padding: 4px 0px; - z-index: 1; -} - -.leftIconContainer { - @extend .iconContainer; - left: 0; -} - -.rightIconContainer { - @extend .iconContainer; - right: 0; -} - -.icon { - width: 16px; - margin: auto; -} - -.title { - font-weight: 500; - font-size: 20px; -} - -.titleAlignLeft { - font-size: 16px; - margin-top: 1px; -} \ No newline at end of file diff --git a/src/components/organisms/ModalSelector.js b/src/components/organisms/ModalSelector.js deleted file mode 100644 index 31fa435..0000000 --- a/src/components/organisms/ModalSelector.js +++ /dev/null @@ -1,50 +0,0 @@ -import React, { Component } from 'react'; -import { FlatList, Image, Text, TouchableOpacity, View } from 'react-native'; -import GlobalStyles from '@src/styles/GlobalStyles'; -import Card from '@src/components/atoms/Card'; -import translate from '@src/locales/i18n'; -import styles from './ModalSelector.styl'; -import BottomModal from '@src/components/atoms/BottomModal/BottomModal'; - -type Props = { - data: any[], - selectedItem: any, - isModalOpen: boolean, - onClose: () => {}, - onSelect: () => {}, -}; - -export default class ModalSelector extends Component { - renderItem = ({ item }: { item: string }) => { - const { selectedItem, onSelect } = this.props; - - return ( - onSelect(item)} - style={[styles.selectItem, selectedItem === item ? styles.selectItemActive : '']} - > - {item} - - ); - }; - - keyExtractor = (item: string) => item; - - render() { - const { isModalOpen, data, onClose } = this.props; - - return ( - - - - - - - {translate('Settings.currency.selectBoxTitle')} - - - - - ); - } -} diff --git a/src/components/organisms/ModalSelector.styl b/src/components/organisms/ModalSelector.styl deleted file mode 100644 index 57a6e35..0000000 --- a/src/components/organisms/ModalSelector.styl +++ /dev/null @@ -1,72 +0,0 @@ -.bottomCardWrapper { - flex: 1; - flex-direction: column; - justify-content: flex-end; - align-items: center; -} - -.modalOverlay { - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; -} - -.bottomCard { - min-height: 300px; - padding: 20px 0px 28px; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - flex: 0.6; - width: 100%; -} - -.titleContainer { - flex-direction: row; - justify-content: center; - align-items: center; - padding-bottom: 16px; -} - -.title { - padding-left: 8px; - font-size: 16px; - font-weight: bold; - color: #000000; -} - -.input { - color: #000000; -} - -.closeButton { - justify-content: flex-end; - align-items: flex-start; - padding: 0px 20px; - flex-direction: row; -} - -.closeIcon { - width: 18px; - height: 18px; -} - -.selectItem { - justify-content: space-between; - border-bottom-width: 1px; - border-bottom-color: #D8D8D8; - padding: 16px 20px; -} - -.selectItemActive { - border-left-width: 4px; - border-left-color: #1AB5AC; - background-color: #F6F6F6; -} - -.itemText { - font-size: 16px; - color: #000000; - text-transform: uppercase; -} \ No newline at end of file diff --git a/src/components/organisms/SymbolPageView.js b/src/components/organisms/SymbolPageView.js index 46d59ac..9349253 100644 --- a/src/components/organisms/SymbolPageView.js +++ b/src/components/organisms/SymbolPageView.js @@ -5,7 +5,6 @@ import SymbolGradientContainer from '@src/components/organisms/SymbolGradientCon import FadeView from '@src/components/organisms/FadeView'; import GradientButton from '@src/components/atoms/GradientButton'; import GradientButtonLight from '@src/components/atoms/GradientButtonLight'; -import CompoundButton from '@src/components/atoms/CompoundButton'; import LoadingAnimation from '@src/components/organisms/LoadingAnimation'; const styles = StyleSheet.create({ @@ -239,8 +238,6 @@ type Props = { buttons: Button[], errorButtons: Button[], - separateButtons: boolean, - separateErrorButtons: boolean, footer: Node, footerTitle: string, @@ -266,8 +263,6 @@ const WizardStepView = (props: Props) => { noScroll, buttons, errorButtons, - separateButtons, - separateErrorButtons, footer, footerTitle, @@ -477,20 +472,7 @@ const WizardStepView = (props: Props) => { onPress={buttons[0].onPress} /> )} - {!separateButtons && !isLoading && !isError && buttons && buttons.length === 2 && ( - - )} - {separateButtons && !isLoading && !isError && buttons && buttons.length === 2 && ( + {!isLoading && !isError && buttons && buttons.length === 2 && (