diff --git a/android/app/build.gradle b/android/app/build.gradle index 31c7158397..4bf802c038 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -93,7 +93,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode VERSIONCODE as Integer - versionName "4.55.0" + versionName "4.56.0" vectorDrawables.useSupportLibrary = true if (!isFoss) { manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String] diff --git a/app/containers/Button/index.tsx b/app/containers/Button/index.tsx index 61be086558..b9e6bf0658 100644 --- a/app/containers/Button/index.tsx +++ b/app/containers/Button/index.tsx @@ -38,6 +38,11 @@ const styles = StyleSheet.create({ ...sharedStyles.textMedium, ...sharedStyles.textAlignCenter }, + smallText: { + ...sharedStyles.textBold, + fontSize: 12, + lineHeight: 18 + }, disabled: { opacity: 0.3 } @@ -75,7 +80,11 @@ const Button: React.FC = ({ style ]; - const textStyle = [styles.text, { color: isDisabled ? colors.buttonPrimaryDisabled : resolvedTextColor, fontSize }, styleText]; + const textStyle = [ + { color: isDisabled ? colors.buttonPrimaryDisabled : resolvedTextColor, fontSize }, + small ? styles.smallText : styles.text, + styleText + ]; return ( void; cancel?: () => void; @@ -55,15 +58,31 @@ const methods: IMethods = { } }; -const TwoFactor = React.memo(({ isMasterDetail }: { isMasterDetail: boolean }) => { - const { theme } = useTheme(); +const TwoFactor = React.memo(() => { + const { colors } = useTheme(); + const { isMasterDetail } = useAppSelector(state => ({ + isMasterDetail: state.app.isMasterDetail as boolean + })); const [visible, setVisible] = useState(false); const [data, setData] = useState({}); const [code, setCode] = useState(''); const method = data.method ? methods[data.method] : null; const isEmail = data.method === 'email'; - const sendEmail = () => Services.sendEmailCode(); + const params = data?.params; + + const sendEmail = async () => { + try { + if (params?.user) { + const response = await Services.sendEmailCode(params?.user); + if (response.success) { + showToast(I18n.t('Two_Factor_Success_message')); + } + } + } catch (e) { + log(e) + } + }; useDeepCompareEffect(() => { if (!isEmpty(data)) { @@ -102,7 +121,7 @@ const TwoFactor = React.memo(({ isMasterDetail }: { isMasterDetail: boolean }) = setData({}); }; - const color = themes[theme].fontTitlesLabels; + const color = colors.fontTitlesLabels; return ( @@ -110,7 +129,7 @@ const TwoFactor = React.memo(({ isMasterDetail }: { isMasterDetail: boolean }) = style={[ styles.content, isMasterDetail && [sharedStyles.modalFormSheet, styles.tablet], - { backgroundColor: themes[theme].surfaceTint } + { backgroundColor: colors.surfaceTint } ]}> {I18n.t(method?.title || 'Two_Factor_Authentication')} {method?.text ? {I18n.t(method.text)} : null} @@ -127,22 +146,23 @@ const TwoFactor = React.memo(({ isMasterDetail }: { isMasterDetail: boolean }) = testID='two-factor-input' /> {isEmail ? ( - - {I18n.t('Resend_email')} - +