Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: PPOM - What's New copy text refers to OpenSea previous feature - non existing in Mobile #7797

Merged
merged 5 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 33 additions & 22 deletions app/components/UI/WhatsNewModal/WhatsNewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import React, { useCallback, useRef, useState } from 'react';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
Image,
TouchableWithoutFeedback,
NativeSyntheticEvent,
NativeScrollEvent,
Platform,
} from 'react-native';
import { fontStyles } from '../../../styles/common';
import Icon from 'react-native-vector-icons/FontAwesome';
import { strings } from '../../../../locales/i18n';
import Device from '../../../util/device';
import AsyncStorage from '../../../store/async-storage-wrapper';
Expand All @@ -21,6 +18,15 @@ import {
} from '../../../constants/storage';
import StyledButton from '../StyledButton';
import { useTheme } from '../../../util/theme';
import Text, {
TextColor,
TextVariant,
} from '../../../component-library/components/Texts/Text';
import Icon, {
IconColor,
IconName,
IconSize,
} from '../../../component-library/components/Icons/Icon';
import ReusableModal, { ReusableModalRef } from '../ReusableModal';
import { whatsNewList } from './';
import { Colors } from '../../../util/theme/models';
Expand Down Expand Up @@ -77,18 +83,10 @@ const createStyles = (colors: Colors) =>
marginBottom: 20,
paddingHorizontal: modalPadding,
},
headerCenterAux: {
flex: 1,
},
headerClose: {
flex: 1,
alignItems: 'flex-end',
},
headerText: {
...fontStyles.bold,
fontSize: 18,
color: colors.text.default,
},
slideImageContainer: {
flexDirection: 'row',
borderRadius: 10,
Expand All @@ -101,16 +99,10 @@ const createStyles = (colors: Colors) =>
height: slideImageHeight,
},
slideTitle: {
...fontStyles.bold,
fontSize: 16,
marginBottom: 12,
color: colors.text.default,
},
slideDescription: {
...fontStyles.normal,
fontSize: 14,
lineHeight: 20,
color: colors.text.default,
marginBottom: 24,
},
screen: { justifyContent: 'center', alignItems: 'center' },
Expand Down Expand Up @@ -151,10 +143,24 @@ const WhatsNewModal = () => {
const renderSlideElement = (elementInfo: any) => {
switch (elementInfo.type) {
case 'title':
return <Text style={styles.slideTitle}>{elementInfo.title}</Text>;
return (
<Text
color={TextColor.Default}
variant={TextVariant.BodyLGMedium}
style={styles.slideTitle}
>
{elementInfo.title}
</Text>
);
case 'description':
return (
<Text style={styles.slideDescription}>{elementInfo.description}</Text>
<Text
color={TextColor.Default}
variant={TextVariant.HeadingSMRegular}
style={styles.slideDescription}
>
{elementInfo.description}
</Text>
);
case 'image':
return (
Expand Down Expand Up @@ -208,15 +214,20 @@ const WhatsNewModal = () => {

const renderHeader = () => (
<View style={styles.header}>
<View style={styles.headerCenterAux} />
<Text style={styles.headerText}>{strings('whats_new.title')}</Text>
<Text color={TextColor.Default} variant={TextVariant.HeadingMD}>
{strings('whats_new.title')}
</Text>
<View style={styles.headerClose}>
<TouchableOpacity
onPress={() => dismissModal()}
hitSlop={{ top: 10, left: 10, bottom: 10, right: 10 }}
{...generateTestId(Platform, WhatsNewModalSelectorsIDs.CLOSE_BUTTON)}
>
<Icon name="times" size={16} color={colors.icon.default} />
<Icon
name={IconName.Close}
size={IconSize.Md}
color={IconColor.Default}
/>
</TouchableOpacity>
</View>
</View>
Expand Down
12 changes: 4 additions & 8 deletions app/components/UI/WhatsNewModal/whatsNewList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@ export const whatsNew: WhatsNew = {
slides: isBlockaidFeatureEnabled()
? [
[
{
type: 'image',
image: require('../../../images/whats_new_blockaid.png'),
},
{
type: 'title',
title: strings('whats_new.blockaid.title'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_1'),
type: 'image',
image: require('../../../images/whats_new_blockaid.png'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_2'),
description: strings('whats_new.blockaid.description_1'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_3'),
description: strings('whats_new.blockaid.description_2'),
},
{
type: 'button',
Expand Down
5 changes: 2 additions & 3 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2207,12 +2207,11 @@
"ok": "OK"
},
"whats_new": {
"title": "See what's new",
"title": "What's new",
"blockaid": {
"title": "Stay safe with security alerts",
"description_1": "Steer clear of known scams while still preserving your privacy with security alerts powered by Blockaid.",
"description_1": "Steer clear of known scams while still preserving your privacy with security alerts powered by Blockaid on Ethereum Mainnet.",
"description_2": "Always do your own due diligence before approving requests.",
"description_3": "If you enabled security alerts from OpenSea, we've moved you over to this feature.",
"action_text": "Enable security alerts"
}
},
Expand Down
Loading