From acef4989ce1473839401dcfef0d8ffd0f59180b5 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Wed, 4 Nov 2020 14:38:00 -0800 Subject: [PATCH 1/2] Stop using non-existing StyleSheet.Styles type --- src/Buttons/PrimaryButton.js | 6 ++--- src/Buttons/SecondaryButton.js | 6 ++--- src/Buttons/TertiaryButton.js | 6 ++--- src/Gradient/Gradient.js | 3 +-- src/Modals/InputModal/InputModal.js | 24 +++++++++---------- src/Modals/SecureTextModal/SecureTextModal.js | 24 +++++++++---------- src/Scene/Body.js | 4 ++-- src/Scene/Footer.js | 2 +- src/Scene/Header.js | 4 ++-- src/Scene/Item.js | 2 +- src/Scene/Padding.js | 2 +- src/Scene/Row.js | 2 +- src/Scene/Scene.js | 2 +- storybook/helpers/TabBar.js | 6 ++--- 14 files changed, 45 insertions(+), 48 deletions(-) diff --git a/src/Buttons/PrimaryButton.js b/src/Buttons/PrimaryButton.js index 644c72c..fe5d420 100644 --- a/src/Buttons/PrimaryButton.js +++ b/src/Buttons/PrimaryButton.js @@ -2,13 +2,13 @@ import React, { Component } from 'react' import type { Node } from 'react-native' -import { Text as RNText, StyleSheet, TouchableHighlight, View } from 'react-native' +import { Text as RNText, TouchableHighlight, View } from 'react-native' import { rawStyles, styles } from './style.js' export type TextProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } class Text extends Component { render () { @@ -28,7 +28,7 @@ class Text extends Component { export type Props = { children: Node, - style?: StyleSheet.Styles, + style?: Object, onPress: () => void } export class PrimaryButton extends Component { diff --git a/src/Buttons/SecondaryButton.js b/src/Buttons/SecondaryButton.js index c1c557d..0eb370f 100644 --- a/src/Buttons/SecondaryButton.js +++ b/src/Buttons/SecondaryButton.js @@ -2,13 +2,13 @@ import React, { Component } from 'react' import type { Node } from 'react-native' -import { Text as RNText, StyleSheet, TouchableHighlight, View } from 'react-native' +import { Text as RNText, TouchableHighlight, View } from 'react-native' import { rawStyles, styles } from './style.js' export type TextProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } class Text extends Component { render () { @@ -28,7 +28,7 @@ class Text extends Component { export type Props = { children: Node, - style?: StyleSheet.Styles, + style?: Object, onPress: () => void } export class SecondaryButton extends Component { diff --git a/src/Buttons/TertiaryButton.js b/src/Buttons/TertiaryButton.js index 9eeccab..dc3a2fb 100644 --- a/src/Buttons/TertiaryButton.js +++ b/src/Buttons/TertiaryButton.js @@ -2,13 +2,13 @@ import React, { Component } from 'react' import type { Node } from 'react-native' -import { Text as RNText, StyleSheet, TouchableHighlight, View } from 'react-native' +import { Text as RNText, TouchableHighlight, View } from 'react-native' import { rawStyles, styles } from './style.js' export type TextProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } class Text extends Component { render () { @@ -28,7 +28,7 @@ class Text extends Component { export type Props = { children: Node, - style?: StyleSheet.Styles, + style?: Object, onPress: () => void } export class TertiaryButton extends Component { diff --git a/src/Gradient/Gradient.js b/src/Gradient/Gradient.js index 047e3d4..a4c5beb 100644 --- a/src/Gradient/Gradient.js +++ b/src/Gradient/Gradient.js @@ -28,8 +28,7 @@ export type Props = { colors?: Array, start?: Coordinates, end?: Coordinates, - // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Gradient extends Component { diff --git a/src/Modals/InputModal/InputModal.js b/src/Modals/InputModal/InputModal.js index 2af6b4c..45d1238 100644 --- a/src/Modals/InputModal/InputModal.js +++ b/src/Modals/InputModal/InputModal.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import type { Node } from 'react' -import { StyleSheet, Text, View } from 'react-native' +import { Text, View } from 'react-native' import { PrimaryButton, SecondaryButton } from '../../Buttons' import { FormField } from '../../FormField' @@ -12,7 +12,7 @@ import { styles } from '../ModalStyle.js' // CONTAINER ///////////////////////////////////////////////////////////////////////////// export type ContainerProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Container extends Component { render () { @@ -28,7 +28,7 @@ export class Container extends Component { // HEADER ///////////////////////////////////////////////////////////////////////////// export type HeaderProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Header extends Component { render () { @@ -51,7 +51,7 @@ export class Header extends Component { https://github.com/facebook/react-native/issues/6802 */ type AndroidHackSpacerProps = { - style?: StyleSheet.Styles + style?: Object } export class AndroidHackSpacer extends Component { render () { @@ -62,7 +62,7 @@ export class AndroidHackSpacer extends Component { // ICON ///////////////////////////////////////////////////////////////////////////// export type IconProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Icon extends Component { static AndroidHackSpacer = AndroidHackSpacer @@ -79,7 +79,7 @@ export class Icon extends Component { // TITLE ///////////////////////////////////////////////////////////////////////////// type TitleProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Title extends Component { render () { @@ -95,7 +95,7 @@ export class Title extends Component { // DESCRIPTION ///////////////////////////////////////////////////////////////////////////// export type DescriptionProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Description extends Component { render () { @@ -111,7 +111,7 @@ export class Description extends Component { // BODY ///////////////////////////////////////////////////////////////////////////// type BodyProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Body extends Component { render () { @@ -127,7 +127,7 @@ export class Body extends Component { // FOOTER ///////////////////////////////////////////////////////////////////////////// type FooterProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Footer extends Component { render () { @@ -139,7 +139,7 @@ export class Footer extends Component { // Item ///////////////////////////////////////////////////////////////////////////// type ItemProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Item extends Component { render () { @@ -155,7 +155,7 @@ export class Item extends Component { // Row ///////////////////////////////////////////////////////////////////////////// type RowProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Row extends Component { render () { @@ -171,7 +171,7 @@ export class Row extends Component { // INTERACTIVE_MODAL ///////////////////////////////////////////////////////////////////////////// type InputModalProps = { isActive?: boolean, - style?: StyleSheet.Styles, + style?: Object, input: {| label: string, autoCorrect?: boolean, diff --git a/src/Modals/SecureTextModal/SecureTextModal.js b/src/Modals/SecureTextModal/SecureTextModal.js index 38bcb23..e9c7190 100644 --- a/src/Modals/SecureTextModal/SecureTextModal.js +++ b/src/Modals/SecureTextModal/SecureTextModal.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import type { Node } from 'react' -import { StyleSheet, Text, View } from 'react-native' +import { Text, View } from 'react-native' import { PrimaryButton, SecondaryButton } from '../../Buttons' import { FormField } from '../../FormField' @@ -12,7 +12,7 @@ import { styles } from '../ModalStyle.js' // CONTAINER ///////////////////////////////////////////////////////////////////////////// export type ContainerProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Container extends Component { render () { @@ -28,7 +28,7 @@ export class Container extends Component { // HEADER ///////////////////////////////////////////////////////////////////////////// export type HeaderProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Header extends Component { render () { @@ -51,7 +51,7 @@ export class Header extends Component { https://github.com/facebook/react-native/issues/6802 */ type AndroidHackSpacerProps = { - style?: StyleSheet.Styles + style?: Object } export class AndroidHackSpacer extends Component { render () { @@ -62,7 +62,7 @@ export class AndroidHackSpacer extends Component { // ICON ///////////////////////////////////////////////////////////////////////////// export type IconProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Icon extends Component { static AndroidHackSpacer = AndroidHackSpacer @@ -79,7 +79,7 @@ export class Icon extends Component { // TITLE ///////////////////////////////////////////////////////////////////////////// type TitleProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Title extends Component { render () { @@ -95,7 +95,7 @@ export class Title extends Component { // DESCRIPTION ///////////////////////////////////////////////////////////////////////////// export type DescriptionProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Description extends Component { render () { @@ -111,7 +111,7 @@ export class Description extends Component { // BODY ///////////////////////////////////////////////////////////////////////////// type BodyProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Body extends Component { render () { @@ -127,7 +127,7 @@ export class Body extends Component { // FOOTER ///////////////////////////////////////////////////////////////////////////// type FooterProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Footer extends Component { render () { @@ -139,7 +139,7 @@ export class Footer extends Component { // Item ///////////////////////////////////////////////////////////////////////////// type ItemProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Item extends Component { render () { @@ -155,7 +155,7 @@ export class Item extends Component { // Row ///////////////////////////////////////////////////////////////////////////// type RowProps = { children: Node, - style?: StyleSheet.Styles + style?: Object } export class Row extends Component { render () { @@ -171,7 +171,7 @@ export class Row extends Component { // INTERACTIVE_MODAL ///////////////////////////////////////////////////////////////////////////// type SecureTextModalProps = { isActive?: boolean, - style?: StyleSheet.Styles, + style?: Object, input: {| label: string, autoCorrect?: boolean, diff --git a/src/Scene/Body.js b/src/Scene/Body.js index 844ea72..2753453 100644 --- a/src/Scene/Body.js +++ b/src/Scene/Body.js @@ -27,7 +27,7 @@ export const styles = StyleSheet.create(rawStyles) export type TextProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Text extends Component { render () { @@ -44,7 +44,7 @@ export class Text extends Component { export type BodyProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Body extends Component { static Text = Text diff --git a/src/Scene/Footer.js b/src/Scene/Footer.js index 82f7927..86afab9 100644 --- a/src/Scene/Footer.js +++ b/src/Scene/Footer.js @@ -15,7 +15,7 @@ export const styles = StyleSheet.create(rawStyles) export type FooterProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Footer extends Component { static Text = RNText diff --git a/src/Scene/Header.js b/src/Scene/Header.js index a3a121b..a9e595e 100644 --- a/src/Scene/Header.js +++ b/src/Scene/Header.js @@ -28,7 +28,7 @@ export const styles = StyleSheet.create(rawStyles) export type TextProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Text extends Component { render () { @@ -45,7 +45,7 @@ export class Text extends Component { export type Props = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Header extends Component { static Text = Text diff --git a/src/Scene/Item.js b/src/Scene/Item.js index fe63fbe..4802a0c 100644 --- a/src/Scene/Item.js +++ b/src/Scene/Item.js @@ -19,7 +19,7 @@ export const styles = StyleSheet.create(rawStyles) export type ItemProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Item extends Component { render () { diff --git a/src/Scene/Padding.js b/src/Scene/Padding.js index f56190e..4aa05a1 100644 --- a/src/Scene/Padding.js +++ b/src/Scene/Padding.js @@ -18,7 +18,7 @@ export const styles = StyleSheet.create(rawStyles) export type PaddingProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Padding extends Component { render () { diff --git a/src/Scene/Row.js b/src/Scene/Row.js index 84bc1c6..84087f7 100644 --- a/src/Scene/Row.js +++ b/src/Scene/Row.js @@ -21,7 +21,7 @@ export const styles = StyleSheet.create(rawStyles) export type RowProps = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Row extends Component { render () { diff --git a/src/Scene/Scene.js b/src/Scene/Scene.js index 7f645e1..a37cd40 100644 --- a/src/Scene/Scene.js +++ b/src/Scene/Scene.js @@ -26,7 +26,7 @@ export const styles = StyleSheet.create(rawStyles) export type Props = { children?: Node, // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Scene extends Component { static Padding = Padding diff --git a/storybook/helpers/TabBar.js b/storybook/helpers/TabBar.js index a6f2f89..6759ee7 100644 --- a/storybook/helpers/TabBar.js +++ b/storybook/helpers/TabBar.js @@ -35,8 +35,7 @@ const styles = StyleSheet.create(rawStyles) export type TabProps = { children?: Node, - // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Tab extends Component { render () { @@ -47,8 +46,7 @@ export class Tab extends Component { export type TextProps = { children?: Node, - // $FlowFixMe - style?: StyleSheet.Styles + style?: Object } export class Text extends Component { render () { From 744adfcbe2816e4186fa9ca61773f477683d9ca8 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Wed, 4 Nov 2020 14:35:46 -0800 Subject: [PATCH 2/2] Remove unused internal files --- src/Buttons/Button.js | 0 src/Buttons/index.js | 7 -- src/Buttons/style.js | 2 +- src/FormField/FormFieldStyle.js | 4 +- src/FormField/index.js | 5 -- src/Gradient/Gradient.js | 2 +- src/Modals/InputModal/InputModal.js | 5 +- src/Modals/ModalStyle.js | 2 +- src/Modals/SecureTextModal/SecureTextModal.js | 13 ++- src/Modals/components/styles.js | 2 +- src/Modals/index.js | 16 ---- src/Scene/Body.js | 2 +- src/Scene/Header.js | 2 +- src/constants/Colors.js | 38 --------- src/constants/Fonts.js | 30 ------- src/constants/OtpConstants.js | 4 - src/constants/Theme.js | 21 ----- src/constants/index.js | 80 ------------------- src/edge-theme.js | 2 - src/index.js | 33 ++++---- storybook/helpers/TabBar.js | 2 +- storybook/helpers/Welcome.js | 2 +- 22 files changed, 38 insertions(+), 236 deletions(-) delete mode 100644 src/Buttons/Button.js delete mode 100644 src/Buttons/index.js delete mode 100644 src/FormField/index.js delete mode 100644 src/Modals/index.js delete mode 100644 src/constants/Colors.js delete mode 100644 src/constants/Fonts.js delete mode 100644 src/constants/OtpConstants.js delete mode 100644 src/constants/Theme.js delete mode 100644 src/constants/index.js diff --git a/src/Buttons/Button.js b/src/Buttons/Button.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/Buttons/index.js b/src/Buttons/index.js deleted file mode 100644 index e875702..0000000 --- a/src/Buttons/index.js +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable flowtype/require-valid-file-annotation */ - -import { PrimaryButton } from './PrimaryButton.js' -import { SecondaryButton } from './SecondaryButton.js' -import { TertiaryButton } from './TertiaryButton.js' - -export { PrimaryButton, SecondaryButton, TertiaryButton } diff --git a/src/Buttons/style.js b/src/Buttons/style.js index 4bfe291..0a17983 100644 --- a/src/Buttons/style.js +++ b/src/Buttons/style.js @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native' -import THEME from '../edge-theme.js' +import { THEME } from '../edge-theme.js' import { scale } from '../scaling.js' export const rawStyles = { diff --git a/src/FormField/FormFieldStyle.js b/src/FormField/FormFieldStyle.js index 01def20..2f777cb 100644 --- a/src/FormField/FormFieldStyle.js +++ b/src/FormField/FormFieldStyle.js @@ -1,12 +1,12 @@ // @flow -import * as Colors from '../constants/Colors' +import { THEME } from '../edge-theme.js' import { scale } from '../scaling.js' const InputStyles = { container: { position: 'relative', - borderBottomColor: Colors.PRIMARY, + borderBottomColor: THEME.COLORS.PRIMARY, borderBottomWidth: 1, width: '100%' }, diff --git a/src/FormField/index.js b/src/FormField/index.js deleted file mode 100644 index 3ede212..0000000 --- a/src/FormField/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -import { FormField } from './FormField.js' - -export { FormField } diff --git a/src/Gradient/Gradient.js b/src/Gradient/Gradient.js index a4c5beb..0180ffe 100644 --- a/src/Gradient/Gradient.js +++ b/src/Gradient/Gradient.js @@ -5,7 +5,7 @@ import type { Node } from 'react' import { StyleSheet } from 'react-native' import LinearGradient from 'react-native-linear-gradient' -import THEME from '../edge-theme.js' +import { THEME } from '../edge-theme.js' type Coordinates = { x: number, y: number } diff --git a/src/Modals/InputModal/InputModal.js b/src/Modals/InputModal/InputModal.js index 45d1238..c049232 100644 --- a/src/Modals/InputModal/InputModal.js +++ b/src/Modals/InputModal/InputModal.js @@ -4,8 +4,9 @@ import React, { Component } from 'react' import type { Node } from 'react' import { Text, View } from 'react-native' -import { PrimaryButton, SecondaryButton } from '../../Buttons' -import { FormField } from '../../FormField' +import { PrimaryButton } from '../../Buttons/PrimaryButton.js' +import { SecondaryButton } from '../../Buttons/SecondaryButton.js' +import { FormField } from '../../FormField/FormField.js' import { InputAndButtonStyle, MaterialInputStyle } from '../components/styles.js' import { styles } from '../ModalStyle.js' diff --git a/src/Modals/ModalStyle.js b/src/Modals/ModalStyle.js index 446e8f5..8e3cb72 100644 --- a/src/Modals/ModalStyle.js +++ b/src/Modals/ModalStyle.js @@ -2,7 +2,7 @@ import { Dimensions, StyleSheet } from 'react-native' -import THEME from '../edge-theme.js' +import { THEME } from '../edge-theme.js' import { scale } from '../scaling.js' export const rawStyles = { diff --git a/src/Modals/SecureTextModal/SecureTextModal.js b/src/Modals/SecureTextModal/SecureTextModal.js index e9c7190..7c6711c 100644 --- a/src/Modals/SecureTextModal/SecureTextModal.js +++ b/src/Modals/SecureTextModal/SecureTextModal.js @@ -4,8 +4,9 @@ import React, { Component } from 'react' import type { Node } from 'react' import { Text, View } from 'react-native' -import { PrimaryButton, SecondaryButton } from '../../Buttons' -import { FormField } from '../../FormField' +import { PrimaryButton } from '../../Buttons/PrimaryButton.js' +import { SecondaryButton } from '../../Buttons/SecondaryButton.js' +import { FormField } from '../../FormField/FormField.js' import { InputAndButtonStyle, MaterialInputStyle } from '../components/styles.js' import { styles } from '../ModalStyle.js' @@ -269,7 +270,13 @@ export class SecureTextModal extends Component - + {this.props.yesButton.title} diff --git a/src/Modals/components/styles.js b/src/Modals/components/styles.js index 171832e..132150d 100644 --- a/src/Modals/components/styles.js +++ b/src/Modals/components/styles.js @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native' -import THEME from '../../edge-theme.js' +import { THEME } from '../../edge-theme.js' import { scale } from '../../scaling.js' export const rawStyles = { diff --git a/src/Modals/index.js b/src/Modals/index.js deleted file mode 100644 index d6d836f..0000000 --- a/src/Modals/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow - -import { InputAndButtonStyle, MaterialInputStyle } from './components/styles.js' -import { InputModal, createInputModal } from './InputModal/InputModal.js' -import { styles as ModalStyle } from './ModalStyle.js' -import { SecureTextModal, createSecureTextModal } from './SecureTextModal/SecureTextModal.js' - -export { - InputModal, - createInputModal, - SecureTextModal, - createSecureTextModal, - ModalStyle, - MaterialInputStyle, - InputAndButtonStyle -} diff --git a/src/Scene/Body.js b/src/Scene/Body.js index 2753453..0b3d9df 100644 --- a/src/Scene/Body.js +++ b/src/Scene/Body.js @@ -4,7 +4,7 @@ import React, { Component } from 'react' import type { Node } from 'react' import { Text as RNText, StyleSheet, View } from 'react-native' -import THEME from '../edge-theme.js' +import { THEME } from '../edge-theme.js' const debug = { // borderColor: 'red', borderWidth: 1 diff --git a/src/Scene/Header.js b/src/Scene/Header.js index a9e595e..ca18471 100644 --- a/src/Scene/Header.js +++ b/src/Scene/Header.js @@ -4,7 +4,7 @@ import React, { Component } from 'react' import type { Node } from 'react' import { Text as RNText, StyleSheet, View } from 'react-native' -import THEME from '../edge-theme.js' +import { THEME } from '../edge-theme.js' const debug = { // borderColor: 'red', borderWidth: 1 diff --git a/src/constants/Colors.js b/src/constants/Colors.js deleted file mode 100644 index 869ccb1..0000000 --- a/src/constants/Colors.js +++ /dev/null @@ -1,38 +0,0 @@ -// @flow - -export const GR_DARK = '#0D2145' -export const GR_LIGHT = '#0E4B75' -export const PRIMARY = '#0D2145' -export const SECONDARY = '#0E4B75' -export const ACCENT_GREEN = '#0073D9' -export const ACCENT_ORANGE = '#F1AA19' -export const ACCENT_RED = '#E85466' -export const ACCENT_MINT = '#66EDA8' -export const GRAY_1 = '#4A5157' -export const GRAY_2 = '#87939E' -export const GRAY_3 = '#D9E3ED' -export const GRAY_4 = '#F4F5F6' -export const BLACK = '#25292C' -export const WHITE = '#FFFFFF' - -export const BUTTON_PRIMARY_UP = '#0E4B75' -export const BUTTON_PRIMARY_UP_TEXT = '#FFFFFF' -export const BUTTON_PRIMARY_DOWN = '#0D2145' -export const BUTTON_SECONDARY_UP = '#87939E' -export const BUTTON_SECONDARY_DOWN = '#4A5157' -// TODO - need colors for tertiary update Allen -export const BUTTON_TERTIARY_UP = '#FFFFFF' -export const BUTTON_TERTIARY_DOWN = 'rgba(73,119,187,0.1)' -export const BUTTON_TERTIARY_UP_OUTLINE = '#0E4B75' -export const BUTTON_TERTIARY_DOWN_OUTLINE = '#0E4B75' -export const BUTTON_DEFAULT_UP = '#FFFFFF' -export const BUTTON_DEFAULT_UP_TEXT = '#0E4B75' -export const BUTTON_DEFAULT_DOWN = '#FFFFFF' -export const BUTTON_DEFAULT_DOWN_TEXT = '#0D2145' - -export const MODAL_DROP = '#FFFFFF' -export const OVERLAY_BOX = 'rgba(255,255,255,.6)' -export const MODAL_BOX = 'rgba(0,0,0,.6)' -export const TRANSPARENT = 'transparent' -export const GRADIENT = ['#0E4B75', '#0D2145'] -export const GRADIENT_REVERSE = ['#0D2145', '#0E4B75'] diff --git a/src/constants/Fonts.js b/src/constants/Fonts.js deleted file mode 100644 index 4cbd11f..0000000 --- a/src/constants/Fonts.js +++ /dev/null @@ -1,30 +0,0 @@ -// @flow - -import { Platform } from 'react-native' - -const platform = Platform.OS -const IOS = 'ios' -const BUTTON_TEXT_SIZE = platform === IOS ? 16 : 16 -const DEFAULT_FONT_TEXT_SIZE = 12 -const SYSTEM = 'System' - -let FONTS = { - defaultButtonTextSize: BUTTON_TEXT_SIZE, - defaultFontSize: DEFAULT_FONT_TEXT_SIZE, - fontFamilyRegular: SYSTEM, - fontFamilyBlack: SYSTEM -} - -const updateFontStyles = (obj: Object) => { - if (!obj.fontDescription) { - return - } - const { fontDescription } = obj - const regular = fontDescription.regularFontFamily ? fontDescription.regularFontFamily : FONTS.fontFamilyRegular - FONTS = { - ...FONTS, - fontFamilyRegular: regular - } -} - -export { FONTS, updateFontStyles } diff --git a/src/constants/OtpConstants.js b/src/constants/OtpConstants.js deleted file mode 100644 index 1c0bd10..0000000 --- a/src/constants/OtpConstants.js +++ /dev/null @@ -1,4 +0,0 @@ -// @flow - -export const OTP_SCREEN_ONE = 'otpScreenOne' -export const OTP_SCREEN_TWO = 'otpScreenTwo' diff --git a/src/constants/Theme.js b/src/constants/Theme.js deleted file mode 100644 index 813035f..0000000 --- a/src/constants/Theme.js +++ /dev/null @@ -1,21 +0,0 @@ -// @flow - -import { Platform } from 'react-native' - -export const HEADER_HEIGHT = Platform.OS === 'ios' ? 42 : 60 -export const STATIC_MODAL_HEADER_HEIGHT = 62 - -export const BUTTON_HEIGHT = 44 -export const BUTTON_WIDTH_1 = '70%' -export const BUTTON_100_PERCENT = '100%' -export const BUTTON_BORDER_STROKE = 1 -export const BUTTON_BORDER_RADIUS = 3 - -// Login Screen -export const LOGIN_LABEL_WIDTH = '70%' -export const LOGIN_LABEL_HEIGHT = 60 -export const LOGIN_TEXT_ONLY_BUTTON_TEXT_HEIGHT = 14 -export const DROP_LABEL_HEIGHT = 40 - -// Create Username -export const USERNAME_INSTRUCTIONS_HEIGHT = 90 diff --git a/src/constants/index.js b/src/constants/index.js deleted file mode 100644 index 5b4548f..0000000 --- a/src/constants/index.js +++ /dev/null @@ -1,80 +0,0 @@ -// @flow - -export * from './Colors' -export * from './Fonts' -export * from './Theme' -export * from './OtpConstants' - -/* export const LEFT_TO_RIGHT = 'leftToRight' -export const RIGHT_TO_LEFT = 'rightToLeft' -export const NONE ='none' -export const FROM ='from' -export const TO ='to' */ -export const ALWAYS = 'always' - -export const WORKFLOW_FIRST_LOAD = 'firstLoadWF' -export const WORKFLOW_INIT = 'initalizeWF' -export const WORKFLOW_CREATE = 'createWF' -export const WORKFLOW_PASSWORD = 'passwordWF' -export const WORKFLOW_PASSWORD_FORCED = 'passwordWFForced' -export const WORKFLOW_PIN = 'pinWF' - -export const WORKFLOW_RECOVERY = 'recoveryWF' -export const WORKFLOW_RECOVERY_LOGIN = 'recoveryLoginWF' -export const WORKFLOW_FINGERPRINT = 'fingerprintWF' -export const WORKFLOW_OTP = 'otpWF' - -export const WORKFLOW_START = 'workflowStart' -export const WORKFLOW_SKIP = 'workflowSkip' -export const WORKFLOW_LAUNCH_MODAL = 'workflowLaunchModal' -export const WORKFLOW_CANCEL_MODAL = 'workflowCancelSkip' -export const WORKFLOW_BACK = 'workflowBack' -export const WORKFLOW_CANCEL = 'workflowCancel' -export const WORKFLOW_NEXT = 'workflowNext' - -// create actions -export const CREATE_UPDATE_USERNAME = 'createUpdateUsername' -export const CREATE_UPDATE_PIN = 'createUpdatePin' -export const LOG_IN_PIN = 'LOG_IN_PIN' -export const LOGIN_SUCCEESS = 'USERNAME_PASSWORD' -export const LOGIN_RECOVERY_SUCCEESS = 'loginRecoverySuccess' -export const LOGIN_USERNAME_PASSWORD_FAIL = 'USERNAME_PASSWORD_FAIL' -export const LOGIN_PIN_FAIL = 'LOGIN_PIN_FAIL' -export const OTP_LOGIN_BACKUPKEY_FAIL = 'otpLoginBackupKeyFail' -export const CREATE_ACCOUNT_SUCCESS = 'CREATE_ACCOUNT_SUCCESS' -export const CREATE_ACCOUNT_FAIL = 'CREATE_ACCOUNT_FAIL' -export const ACCEPT_TERMS_CONDITIONS = 'acceptTermsAndConditions' -export const SET_PREVIOUS_USERS = 'SET_PREVIOUS_USERS' - -// Login Actions -export const AUTH_UPDATE_USERNAME = 'authUpdateUsername' -export const AUTH_UPDATE_PASSWORD = 'authUpdatePassword' -export const AUTH_UPDATE_LOGIN_PASSWORD = 'authUpdateLoginPassword' -export const AUTH_UPDATE_CONFIRM_PASSWORD = 'authUpdatePasswordConfirm' -export const AUTH_UPDATE_PIN = 'authUpdatePin' -export const AUTH_LOGGING_IN_WITH_PIN = 'authLoggingInWithPin' -export const AUTH_UPDATE_OTP_BACKUP_KEY = 'authSetOtpBackupKey' -export const DELETE_USER_FROM_DEVICE = 'deleteUserFromDevice' -export const UPDATE_WAIT_TIMER = 'updatWaitTimer' -// Change Password Pin Actions = -export const LAUNCH_NOTIFICATION_MODAL = 'launchNotificationmodal' -export const CLOSE_NOTIFICATION_MODAL = 'closeNotificationmodal' - -export const OTP_ERROR = 'otpError' -export const OTP_RESET_REQUEST = 'otpResetRequest' -export const START_EDGE_LOGIN_REQUEST = 'onEdgeLoginRequest' -export const CANCEL_EDGE_LOGIN_REQUEST = 'cancelEdgeLoginRequest' - -export const PASSWORD_RECOVERY_INITIALIZED = 'passwordRecoveryInitialized' -export const ON_RECOVERY_KEY = 'onRecoveryKey' -export const ON_RECOVERY_LOGIN_IS_ENABLED = 'onRecoveryLoginIsEnabled' -export const ON_RECOVERY_LOGIN_NOT_ENABLED = 'onRecoveryLoginNOTEnabled' -export const ON_RECOVERY_LOGIN_ERROR = 'onRecoveryLoginError' -export const ON_DISABLE_RECOVERY = 'onDisableRecovery' -export const DISMISS_REOVERY_ERROR = 'dismissRecoveryError' -export const DISMISS_EMAIL_MODAL = 'dismissRecoveryError' -export const RESET_APP = 'resetApplication' - -export const SET_RECOVERY_KEY = 'resetRecoveryKey' -export const CANCEL_RECOVERY_KEY = 'cancelRecoveryKey' -export const START_RECOVERY_LOGIN = 'startRecoveryKeyLogin' diff --git a/src/edge-theme.js b/src/edge-theme.js index 2332446..42d2584 100644 --- a/src/edge-theme.js +++ b/src/edge-theme.js @@ -61,5 +61,3 @@ export const THEME = { TRANSPARENT: 'transparent' } } - -export default THEME diff --git a/src/index.js b/src/index.js index 6fa5f85..2d67ec0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,31 +1,28 @@ // @flow -import { PrimaryButton, SecondaryButton, TertiaryButton } from './Buttons' -import { FormField } from './FormField' +import { PrimaryButton } from './Buttons/PrimaryButton.js' +import { SecondaryButton } from './Buttons/SecondaryButton.js' +import { TertiaryButton } from './Buttons/TertiaryButton.js' +import { FormField } from './FormField/FormField.js' import Gradient from './Gradient/Gradient.js' -import { - InputAndButtonStyle, - InputModal, - MaterialInputStyle, - ModalStyle, - SecureTextModal, - createInputModal, - createSecureTextModal -} from './Modals' +import { InputAndButtonStyle, MaterialInputStyle } from './Modals/components/styles.js' +import { InputModal, createInputModal } from './Modals/InputModal/InputModal.js' +import { styles as ModalStyle } from './Modals/ModalStyle.js' +import { SecureTextModal, createSecureTextModal } from './Modals/SecureTextModal/SecureTextModal.js' import Scene from './Scene/Scene.js' export { - Gradient, - InputModal, createInputModal, - SecureTextModal, createSecureTextModal, - ModalStyle, - MaterialInputStyle, - InputAndButtonStyle, FormField, - Scene, + Gradient, + InputAndButtonStyle, + InputModal, + MaterialInputStyle, + ModalStyle, PrimaryButton, + Scene, SecondaryButton, + SecureTextModal, TertiaryButton } diff --git a/storybook/helpers/TabBar.js b/storybook/helpers/TabBar.js index 6759ee7..89f01af 100644 --- a/storybook/helpers/TabBar.js +++ b/storybook/helpers/TabBar.js @@ -4,7 +4,7 @@ import React, { Component } from 'react' import type { Node } from 'react' import { Text as RNText, StyleSheet, View } from 'react-native' -import THEME from '../../src/edge-theme.js' +import { THEME } from '../../src/edge-theme.js' const debugStyle = { borderColor: 'red', borderWidth: 1 } diff --git a/storybook/helpers/Welcome.js b/storybook/helpers/Welcome.js index 9a48147..feecfc3 100644 --- a/storybook/helpers/Welcome.js +++ b/storybook/helpers/Welcome.js @@ -3,7 +3,7 @@ import React from 'react' import { Text, View } from 'react-native' -import THEME from '../../src/edge-theme.js' +import { THEME } from '../../src/edge-theme.js' import { Gradient } from '../../src/Gradient/Gradient.js' const styles = {