From 43506855a8f4f6969e8ec9da1eb427be0d77449e Mon Sep 17 00:00:00 2001 From: thedoublejay Date: Fri, 23 Jul 2021 09:00:57 +0800 Subject: [PATCH 1/3] added fonts on tailwind --- app/components/SectionTitle.tsx | 4 +-- app/components/Text.tsx | 16 ++++++++++++ app/components/index.tsx | 19 +++++--------- app/hooks/useCachedResources.ts | 13 +++++++++- .../AppNavigator/BottomTabNavigator.tsx | 3 ++- .../screens/Balances/BalancesNavigator.tsx | 5 ++-- .../screens/Balances/BalancesScreen.tsx | 2 +- .../AppNavigator/screens/Dex/DexNavigator.tsx | 3 ++- .../screens/Settings/SettingsNavigator.tsx | 3 ++- .../Transactions/TransactionsNavigator.tsx | 2 ++ .../PlaygroundNavigator.tsx | 3 ++- .../WalletNavigator/WalletNavigator.tsx | 3 ++- app/tailwind.js | 25 ++++++++++++++++++- package-lock.json | 11 ++++++++ package.json | 1 + 15 files changed, 88 insertions(+), 25 deletions(-) create mode 100644 app/components/Text.tsx diff --git a/app/components/SectionTitle.tsx b/app/components/SectionTitle.tsx index 59fb5f101a..3a908d49c4 100644 --- a/app/components/SectionTitle.tsx +++ b/app/components/SectionTitle.tsx @@ -1,12 +1,12 @@ import React from 'react' -import { Text } from 'react-native' import { tailwind } from '../tailwind' +import { Text } from './Text' export function SectionTitle ({ text, testID }: { text: string, testID: string }): JSX.Element { return ( { text diff --git a/app/components/Text.tsx b/app/components/Text.tsx new file mode 100644 index 0000000000..e88716f311 --- /dev/null +++ b/app/components/Text.tsx @@ -0,0 +1,16 @@ +import React from 'react' +import { Text as DefaultText } from 'react-native' +import { tailwind } from '../tailwind' + +export const HeaderFont = tailwind('font-semibold') + +export type TextProps = DefaultText['props'] + +export function Text (props: TextProps): JSX.Element { + const { style, ...otherProps } = props + return ( + + ) +} diff --git a/app/components/index.tsx b/app/components/index.tsx index 38e6bdbb0e..5978fb0aef 100644 --- a/app/components/index.tsx +++ b/app/components/index.tsx @@ -1,17 +1,10 @@ import React from 'react' -import { StyleSheet, Text as DefaultText, TextInput as DefaultTextInput, View as DefaultView } from 'react-native' +import { TextInput as DefaultTextInput, View as DefaultView } from 'react-native' +import { tailwind } from '../tailwind' +import { Text as DefaultText, TextProps } from './Text' -const Default = StyleSheet.create({ - text: { - fontSize: 16, - fontWeight: '600' - } -}) - -export function Text (props: DefaultText['props']): JSX.Element { - const { style, ...otherProps } = props - - return +export function Text (props: TextProps): JSX.Element { + return } export function View (props: DefaultView['props']): JSX.Element { @@ -23,5 +16,5 @@ export function View (props: DefaultView['props']): JSX.Element { export function TextInput (props: DefaultTextInput['props']): JSX.Element { const { style, ...otherProps } = props - return + return } diff --git a/app/hooks/useCachedResources.ts b/app/hooks/useCachedResources.ts index 7072385d04..7a912ddbd9 100644 --- a/app/hooks/useCachedResources.ts +++ b/app/hooks/useCachedResources.ts @@ -1,3 +1,10 @@ +import { + IBMPlexSans_300Light, + IBMPlexSans_400Regular, + IBMPlexSans_500Medium, + IBMPlexSans_600SemiBold, + IBMPlexSans_700Bold +} from '@expo-google-fonts/ibm-plex-sans' import { MaterialIcons } from '@expo/vector-icons' import * as Font from 'expo-font' import { useEffect, useState } from 'react' @@ -22,7 +29,11 @@ async function loadResourcesAndDataAsync (): Promise { try { await Font.loadAsync({ ...MaterialIcons.font, - 'space-mono': require('../assets/fonts/SpaceMono-Regular.ttf') + LightFont: IBMPlexSans_300Light, + RegularFont: IBMPlexSans_400Regular, + MediumFont: IBMPlexSans_500Medium, + SemiBoldFont: IBMPlexSans_600SemiBold, + BoldFont: IBMPlexSans_700Bold }) } catch (e) { // TODO(@defich/wallet): We might want to provide this error information to an error reporting service diff --git a/app/screens/AppNavigator/BottomTabNavigator.tsx b/app/screens/AppNavigator/BottomTabNavigator.tsx index b1d289ce24..dae9ace2d6 100644 --- a/app/screens/AppNavigator/BottomTabNavigator.tsx +++ b/app/screens/AppNavigator/BottomTabNavigator.tsx @@ -3,6 +3,7 @@ import { PathConfigMap } from '@react-navigation/core' import * as React from 'react' import { OceanInterface } from '../../components/OceanInterface/OceanInterface' import { VectorIcon, VectorIconName } from '../../constants/Theme' +import { tailwind } from '../../tailwind' import { BalancesNavigator } from './screens/Balances/BalancesNavigator' import { DexNavigator } from './screens/Dex/DexNavigator' @@ -33,7 +34,7 @@ export function BottomTabNavigator (): JSX.Element { () export function BalancesNavigator (): JSX.Element { return ( - + - {token.displaySymbol} + {token.displaySymbol} ) } diff --git a/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx b/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx index b3f383d0c5..ec5d176a4e 100644 --- a/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx +++ b/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx @@ -79,7 +79,7 @@ function BalanceItemRow ({ token, onPress }: { token: WalletToken, onPress: () = - {token.displaySymbol} + {token.displaySymbol} () export function DexNavigator (): JSX.Element { return ( - + + () export function PlaygroundNavigator (): JSX.Element { return ( - + - + =0.5.6", "@defichain/whale-api-client": ">=0.5.9", "@defichain/whale-api-wallet": ">=0.5.9", + "@expo-google-fonts/ibm-plex-sans": "^0.2.0", "@expo/vector-icons": "^12.0.0", "@expo/webpack-config": "~0.12.63", "@react-native-async-storage/async-storage": "~1.15.0", @@ -2337,6 +2338,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@expo-google-fonts/ibm-plex-sans": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@expo-google-fonts/ibm-plex-sans/-/ibm-plex-sans-0.2.0.tgz", + "integrity": "sha512-d8f3Kfdy9jbRHKOJDimwHOM8CUZKUbR9Y6xgbDgcGfINUIfH9wtk2kJ9lYp8O5si/6nFdHdUARac88KGGewznQ==" + }, "node_modules/@expo/apple-utils": { "version": "0.0.0-alpha.20", "resolved": "https://registry.npmjs.org/@expo/apple-utils/-/apple-utils-0.0.0-alpha.20.tgz", @@ -42565,6 +42571,11 @@ } } }, + "@expo-google-fonts/ibm-plex-sans": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@expo-google-fonts/ibm-plex-sans/-/ibm-plex-sans-0.2.0.tgz", + "integrity": "sha512-d8f3Kfdy9jbRHKOJDimwHOM8CUZKUbR9Y6xgbDgcGfINUIfH9wtk2kJ9lYp8O5si/6nFdHdUARac88KGGewznQ==" + }, "@expo/apple-utils": { "version": "0.0.0-alpha.20", "resolved": "https://registry.npmjs.org/@expo/apple-utils/-/apple-utils-0.0.0-alpha.20.tgz", diff --git a/package.json b/package.json index 5c2f7b29ae..3768af09b8 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@defichain/playground-api-client": ">=0.5.6", "@defichain/whale-api-client": ">=0.5.9", "@defichain/whale-api-wallet": ">=0.5.9", + "@expo-google-fonts/ibm-plex-sans": "^0.2.0", "@expo/vector-icons": "^12.0.0", "@expo/webpack-config": "~0.12.63", "@react-native-async-storage/async-storage": "~1.15.0", From 1f05038690b4474c3aa1449a358032e708ec1da8 Mon Sep 17 00:00:00 2001 From: thedoublejay Date: Fri, 23 Jul 2021 09:08:05 +0800 Subject: [PATCH 2/3] updated tests --- app/components/BarCodeScanner.tsx | 2 +- .../OceanInterface.test.tsx.snap | 5 +- .../BalancesScreen.test.tsx.snap | 81 ++++++++--- .../Balances/screens/ReceiveScreen.tsx | 3 +- .../__snapshots__/ReceiveScreen.test.tsx.snap | 61 +++++--- .../TokenDetailScreen.test.tsx.snap | 132 ++++++++++++------ .../CommunityScreen.test.tsx.snap | 46 ++++-- .../__snapshots__/ErrorBoundary.test.tsx.snap | 10 +- .../components/PlaygroundAction.tsx | 3 +- 9 files changed, 250 insertions(+), 93 deletions(-) diff --git a/app/components/BarCodeScanner.tsx b/app/components/BarCodeScanner.tsx index 828f047c5a..79f1c25ede 100644 --- a/app/components/BarCodeScanner.tsx +++ b/app/components/BarCodeScanner.tsx @@ -1,10 +1,10 @@ import { StackScreenProps } from '@react-navigation/stack' import { BarCodeScanner as DefaultBarCodeScanner } from 'expo-barcode-scanner' import React, { useEffect, useState } from 'react' -import { Text } from 'react-native' import tailwind from 'tailwind-rn' import { View } from '.' import { Logging } from '../api/logging' +import { Text } from '../components/Text' import { BalanceParamList } from '../screens/AppNavigator/screens/Balances/BalancesNavigator' import { translate } from '../translations' diff --git a/app/components/OceanInterface/__snapshots__/OceanInterface.test.tsx.snap b/app/components/OceanInterface/__snapshots__/OceanInterface.test.tsx.snap index 3edb36bd4c..0730314dfa 100644 --- a/app/components/OceanInterface/__snapshots__/OceanInterface.test.tsx.snap +++ b/app/components/OceanInterface/__snapshots__/OceanInterface.test.tsx.snap @@ -53,10 +53,13 @@ exports[`oceanInterface should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { + "fontFamily": "BoldFont", "fontSize": 14, "fontWeight": "700", "lineHeight": 20, diff --git a/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap b/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap index c8aff1da4e..9e23a7a5cb 100644 --- a/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap +++ b/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap @@ -85,16 +85,25 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { - "color": "rgba(107, 114, 128, 1)", - "fontSize": 12, - "fontWeight": "700", - "lineHeight": 16, - "marginTop": 8, - "paddingBottom": 16, - "paddingLeft": 16, - "paddingRight": 16, - "paddingTop": 16, + "fontFamily": "RegularFont", + "fontSize": 16, + "fontWeight": "400", + "lineHeight": 24, }, + Array [ + Object { + "color": "rgba(107, 114, 128, 1)", + "fontFamily": "MediumFont", + "fontSize": 12, + "fontWeight": "500", + "lineHeight": 16, + "marginTop": 8, + "paddingBottom": 16, + "paddingLeft": 16, + "paddingRight": 16, + "paddingTop": 16, + }, + ], ] } testID="balances_title" @@ -241,10 +250,15 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, + }, + Object { + "fontFamily": "MediumFont", + "fontWeight": "500", }, - undefined, ] } /> @@ -254,11 +268,14 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(75, 85, 99, 1)", + "fontFamily": "MediumFont", "fontSize": 12, "fontWeight": "500", "lineHeight": 16, @@ -283,8 +300,10 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginRight": 8, @@ -449,10 +468,15 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, + }, + Object { + "fontFamily": "MediumFont", + "fontWeight": "500", }, - undefined, ] } /> @@ -462,11 +486,14 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(75, 85, 99, 1)", + "fontFamily": "MediumFont", "fontSize": 12, "fontWeight": "500", "lineHeight": 16, @@ -491,8 +518,10 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginRight": 8, @@ -657,10 +686,15 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, + }, + Object { + "fontFamily": "MediumFont", + "fontWeight": "500", }, - undefined, ] } /> @@ -670,11 +704,14 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(75, 85, 99, 1)", + "fontFamily": "MediumFont", "fontSize": 12, "fontWeight": "500", "lineHeight": 16, @@ -699,8 +736,10 @@ exports[`balances page should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginRight": 8, diff --git a/app/screens/AppNavigator/screens/Balances/screens/ReceiveScreen.tsx b/app/screens/AppNavigator/screens/Balances/screens/ReceiveScreen.tsx index 85af010b39..d10af44045 100644 --- a/app/screens/AppNavigator/screens/Balances/screens/ReceiveScreen.tsx +++ b/app/screens/AppNavigator/screens/Balances/screens/ReceiveScreen.tsx @@ -1,9 +1,10 @@ import { MaterialIcons } from '@expo/vector-icons' import * as Clipboard from 'expo-clipboard' import React from 'react' -import { Text, TouchableOpacity, View } from 'react-native' +import { TouchableOpacity, View } from 'react-native' import QRCode from 'react-native-qrcode-svg' import { useSelector } from 'react-redux' +import { Text } from '../../../../../components/Text' import { RootState } from '../../../../../store' import { tailwind } from '../../../../../tailwind' import { translate } from '../../../../../translations' diff --git a/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/ReceiveScreen.test.tsx.snap b/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/ReceiveScreen.test.tsx.snap index 0fb411b58f..90560df6f7 100644 --- a/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/ReceiveScreen.test.tsx.snap +++ b/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/ReceiveScreen.test.tsx.snap @@ -15,13 +15,22 @@ exports[`receive page should match snapshot 1`] = ` > Use this address to receive DFI or any DST @@ -133,10 +142,19 @@ exports[`receive page should match snapshot 1`] = ` @@ -172,12 +190,21 @@ exports[`receive page should match snapshot 1`] = ` Copy diff --git a/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/TokenDetailScreen.test.tsx.snap b/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/TokenDetailScreen.test.tsx.snap index 975fdadd91..bac90f9307 100644 --- a/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/TokenDetailScreen.test.tsx.snap +++ b/app/screens/AppNavigator/screens/Balances/screens/__snapshots__/TokenDetailScreen.test.tsx.snap @@ -33,8 +33,10 @@ exports[`token detail screen should accept DST 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(107, 114, 128, 1)", @@ -50,10 +52,13 @@ exports[`token detail screen should accept DST 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { + "fontFamily": "BoldFont", "fontSize": 24, "fontWeight": "700", "lineHeight": 32, @@ -68,16 +73,25 @@ exports[`token detail screen should accept DST 1`] = ` style={ Array [ Object { - "color": "rgba(107, 114, 128, 1)", - "fontSize": 12, - "fontWeight": "700", - "lineHeight": 16, - "marginTop": 8, - "paddingBottom": 16, - "paddingLeft": 16, - "paddingRight": 16, - "paddingTop": 16, + "fontFamily": "RegularFont", + "fontSize": 16, + "fontWeight": "400", + "lineHeight": 24, }, + Array [ + Object { + "color": "rgba(107, 114, 128, 1)", + "fontFamily": "MediumFont", + "fontSize": 12, + "fontWeight": "500", + "lineHeight": 16, + "marginTop": 8, + "paddingBottom": 16, + "paddingLeft": 16, + "paddingRight": 16, + "paddingTop": 16, + }, + ], ] } testID="title_available_options" @@ -138,8 +152,10 @@ exports[`token detail screen should accept DST 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "flexGrow": 1, @@ -225,8 +241,10 @@ exports[`token detail screen should accept DST 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "flexGrow": 1, @@ -295,8 +313,10 @@ exports[`token detail screen should accept Token DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(107, 114, 128, 1)", @@ -312,10 +332,13 @@ exports[`token detail screen should accept Token DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { + "fontFamily": "BoldFont", "fontSize": 24, "fontWeight": "700", "lineHeight": 32, @@ -330,16 +353,25 @@ exports[`token detail screen should accept Token DFI 1`] = ` style={ Array [ Object { - "color": "rgba(107, 114, 128, 1)", - "fontSize": 12, - "fontWeight": "700", - "lineHeight": 16, - "marginTop": 8, - "paddingBottom": 16, - "paddingLeft": 16, - "paddingRight": 16, - "paddingTop": 16, + "fontFamily": "RegularFont", + "fontSize": 16, + "fontWeight": "400", + "lineHeight": 24, }, + Array [ + Object { + "color": "rgba(107, 114, 128, 1)", + "fontFamily": "MediumFont", + "fontSize": 12, + "fontWeight": "500", + "lineHeight": 16, + "marginTop": 8, + "paddingBottom": 16, + "paddingLeft": 16, + "paddingRight": 16, + "paddingTop": 16, + }, + ], ] } testID="title_available_options" @@ -400,8 +432,10 @@ exports[`token detail screen should accept Token DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "flexGrow": 1, @@ -470,8 +504,10 @@ exports[`token detail screen should accept UTXO DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(107, 114, 128, 1)", @@ -487,10 +523,13 @@ exports[`token detail screen should accept UTXO DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { + "fontFamily": "BoldFont", "fontSize": 24, "fontWeight": "700", "lineHeight": 32, @@ -505,16 +544,25 @@ exports[`token detail screen should accept UTXO DFI 1`] = ` style={ Array [ Object { - "color": "rgba(107, 114, 128, 1)", - "fontSize": 12, - "fontWeight": "700", - "lineHeight": 16, - "marginTop": 8, - "paddingBottom": 16, - "paddingLeft": 16, - "paddingRight": 16, - "paddingTop": 16, + "fontFamily": "RegularFont", + "fontSize": 16, + "fontWeight": "400", + "lineHeight": 24, }, + Array [ + Object { + "color": "rgba(107, 114, 128, 1)", + "fontFamily": "MediumFont", + "fontSize": 12, + "fontWeight": "500", + "lineHeight": 16, + "marginTop": 8, + "paddingBottom": 16, + "paddingLeft": 16, + "paddingRight": 16, + "paddingTop": 16, + }, + ], ] } testID="title_available_options" @@ -575,8 +623,10 @@ exports[`token detail screen should accept UTXO DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "flexGrow": 1, @@ -662,8 +712,10 @@ exports[`token detail screen should accept UTXO DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "flexGrow": 1, @@ -749,8 +801,10 @@ exports[`token detail screen should accept UTXO DFI 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "flexGrow": 1, diff --git a/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/CommunityScreen.test.tsx.snap b/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/CommunityScreen.test.tsx.snap index 66c15fffbe..d31afdcc21 100644 --- a/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/CommunityScreen.test.tsx.snap +++ b/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/CommunityScreen.test.tsx.snap @@ -19,6 +19,7 @@ exports[` should match snapshot 1`] = ` style={ Object { "color": "rgba(156, 163, 175, 1)", + "fontFamily": "RegularFont", "fontSize": 12, "fontWeight": "400", "lineHeight": 16, @@ -31,6 +32,7 @@ exports[` should match snapshot 1`] = ` style={ Object { "color": "rgba(156, 163, 175, 1)", + "fontFamily": "RegularFont", "fontSize": 12, "fontWeight": "400", "lineHeight": 16, @@ -45,6 +47,7 @@ exports[` should match snapshot 1`] = ` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { + "fontFamily": "MediumFont", "fontWeight": "500", "paddingBottom": 16, "paddingLeft": 16, @@ -187,8 +193,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -243,8 +251,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -299,8 +309,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -355,8 +367,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -411,8 +425,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -467,8 +483,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -523,8 +541,10 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "marginLeft": 8, @@ -556,11 +576,14 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(156, 163, 175, 1)", + "fontFamily": "RegularFont", "fontSize": 12, "fontWeight": "400", "lineHeight": 16, @@ -574,11 +597,14 @@ exports[` should match snapshot 1`] = ` style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(156, 163, 175, 1)", + "fontFamily": "RegularFont", "fontSize": 12, "fontWeight": "400", "lineHeight": 16, diff --git a/app/screens/ErrorBoundary/__snapshots__/ErrorBoundary.test.tsx.snap b/app/screens/ErrorBoundary/__snapshots__/ErrorBoundary.test.tsx.snap index 27ecbddbbb..1f922ed4ea 100644 --- a/app/screens/ErrorBoundary/__snapshots__/ErrorBoundary.test.tsx.snap +++ b/app/screens/ErrorBoundary/__snapshots__/ErrorBoundary.test.tsx.snap @@ -87,10 +87,13 @@ exports[`ErrorBoundary when there is an error should render wh style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { + "fontFamily": "BoldFont", "fontSize": 20, "fontWeight": "700", "lineHeight": 28, @@ -105,11 +108,14 @@ exports[`ErrorBoundary when there is an error should render wh style={ Array [ Object { + "fontFamily": "RegularFont", "fontSize": 16, - "fontWeight": "600", + "fontWeight": "400", + "lineHeight": 24, }, Object { "color": "rgba(156, 163, 175, 1)", + "fontFamily": "BoldFont", "fontSize": 14, "fontWeight": "700", "lineHeight": 20, diff --git a/app/screens/PlaygroundNavigator/components/PlaygroundAction.tsx b/app/screens/PlaygroundNavigator/components/PlaygroundAction.tsx index d363e57a63..c463161c52 100644 --- a/app/screens/PlaygroundNavigator/components/PlaygroundAction.tsx +++ b/app/screens/PlaygroundNavigator/components/PlaygroundAction.tsx @@ -1,6 +1,7 @@ import { Ionicons } from '@expo/vector-icons' import React from 'react' -import { Text, TouchableOpacity, View } from 'react-native' +import { TouchableOpacity, View } from 'react-native' +import { Text } from '../../../components/Text' import { tailwind } from '../../../tailwind' export function PlaygroundAction (props: { From e92b976562574278396156978f92780d11f6323b Mon Sep 17 00:00:00 2001 From: thedoublejay Date: Fri, 23 Jul 2021 12:19:44 +0800 Subject: [PATCH 3/3] update pr comments --- app/components/index.tsx | 7 ++----- .../AppNavigator/screens/Balances/BalancesScreen.tsx | 2 +- .../__snapshots__/BalancesScreen.test.tsx.snap | 12 ++++++------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/app/components/index.tsx b/app/components/index.tsx index 5978fb0aef..b1e1bbd644 100644 --- a/app/components/index.tsx +++ b/app/components/index.tsx @@ -1,11 +1,6 @@ import React from 'react' import { TextInput as DefaultTextInput, View as DefaultView } from 'react-native' import { tailwind } from '../tailwind' -import { Text as DefaultText, TextProps } from './Text' - -export function Text (props: TextProps): JSX.Element { - return -} export function View (props: DefaultView['props']): JSX.Element { const { style, ...otherProps } = props @@ -18,3 +13,5 @@ export function TextInput (props: DefaultTextInput['props']): JSX.Element { return } + +export * from './Text' diff --git a/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx b/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx index ec5d176a4e..fea388e32a 100644 --- a/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx +++ b/app/screens/AppNavigator/screens/Balances/BalancesScreen.tsx @@ -83,7 +83,7 @@ function BalanceItemRow ({ token, onPress }: { token: WalletToken, onPress: () = {token.name} diff --git a/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap b/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap index 9e23a7a5cb..859c32eff1 100644 --- a/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap +++ b/app/screens/AppNavigator/screens/Balances/__snapshots__/BalancesScreen.test.tsx.snap @@ -276,9 +276,9 @@ exports[`balances page should match snapshot 1`] = ` Object { "color": "rgba(75, 85, 99, 1)", "fontFamily": "MediumFont", - "fontSize": 12, + "fontSize": 14, "fontWeight": "500", - "lineHeight": 16, + "lineHeight": 20, }, ] } @@ -494,9 +494,9 @@ exports[`balances page should match snapshot 1`] = ` Object { "color": "rgba(75, 85, 99, 1)", "fontFamily": "MediumFont", - "fontSize": 12, + "fontSize": 14, "fontWeight": "500", - "lineHeight": 16, + "lineHeight": 20, }, ] } @@ -712,9 +712,9 @@ exports[`balances page should match snapshot 1`] = ` Object { "color": "rgba(75, 85, 99, 1)", "fontFamily": "MediumFont", - "fontSize": 12, + "fontSize": 14, "fontWeight": "500", - "lineHeight": 16, + "lineHeight": 20, }, ] }