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(yoroi): uat #3596

Merged
merged 6 commits into from
Sep 4, 2024
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
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const Button = (props: ButtonProps) => {
outlineOnLight && styles.textOutlineOnLight,
outlineOnLight && shelleyTheme && styles.textShelleyOutlineOnLight,
outlineShelley && styles.textOutlineShelley,
props.disabled && styles.buttonDisabledText,
props.disabled && !outlineOnLight && styles.buttonDisabledText,
textStyles,
]}
>
Expand Down
4 changes: 3 additions & 1 deletion apps/wallet-mobile/src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const TextInput = React.forwardRef((props: TextInputProps, ref: Forwarded
const [showPassword, setShowPassword] = React.useState(false)
const [errorTextEnabled, setErrorTextEnabled] = React.useState(errorOnMount)
const {styles, colors} = useStyles()
const {isDark} = useTheme()
useDebounced(
React.useCallback(() => setErrorTextEnabled(true), []),
value,
Expand Down Expand Up @@ -103,6 +104,7 @@ export const TextInput = React.forwardRef((props: TextInputProps, ref: Forwarded
autoCorrect={false}
autoComplete={autoComplete}
autoCapitalize="none"
keyboardAppearance={isDark ? 'dark' : 'light'} // ios feature
autoFocus={selectTextOnAutoFocus || autoFocus}
onFocus={(event) => {
// selectTextOnFocus + autoFocus doesn't work as expected
Expand Down Expand Up @@ -244,7 +246,7 @@ const useStyles = () => {

const colors = {
...color,
background: color.gray_min,
background: color.bg_color_max,
gray: color.gray_400,
textInput: color.gray_600,
actionGray: color.gray_500,
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/components/TokenIcon/TokenIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const useStyles = () => {
const {color} = useTheme()
const styles = StyleSheet.create({
primary: {
backgroundColor: color.primary_600,
backgroundColor: color.primary_500,
},
icon: {
backgroundColor: 'transparent',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Props = {
export const BrowserSearchToolbar = ({onBack, onSearchChange, onSearchSubmit, searchValue}: Props) => {
const {styles} = useStyles()
const {track} = useMetrics()
const {isDark} = useTheme()

React.useEffect(() => {
let timeout: ReturnType<typeof setTimeout> | undefined
Expand Down Expand Up @@ -46,6 +47,7 @@ export const BrowserSearchToolbar = ({onBack, onSearchChange, onSearchSubmit, se
style={styles.searchInputStyle}
onSubmitEditing={onSearchSubmit}
enablesReturnKeyAutomatically={searchValue.length === 0}
keyboardAppearance={isDark ? 'dark' : 'light'}
/>
</View>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,19 @@ export const InitialScreen = () => {

const LanguagePickRow = ({onPress}: {onPress: () => void}) => {
const {styles, color} = useStyles()
const {isDark} = useTheme()
const {languageCode, supportedLanguages} = useLanguage()
const language = supportedLanguages.find((lang) => lang.code === languageCode) ?? defaultLanguage

return (
<TouchableOpacity onPress={onPress} testID="dropDownLanguagePicker">
<TextInput style={styles.input} value={language.label} pointerEvents="none" editable={false} />
<TextInput
style={styles.input}
value={language.label}
pointerEvents="none"
editable={false}
keyboardAppearance={isDark ? 'dark' : 'light'}
/>

<View style={styles.inputIcon}>
<Icon.Chevron size={34} direction="down" color={color.el_gray_medium} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const useStyles = () => {
const {color} = useTheme()
const styles = StyleSheet.create({
primary: {
backgroundColor: color.primary_600,
backgroundColor: color.primary_500,
},
iconMedium: {
backgroundColor: 'transparent',
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet-mobile/src/features/Search/SearchContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ type Props = {
}
const InputSearch = ({placeholder}: Props) => {
const {search, searchChanged} = useSearch()
const {color} = useTheme()
const {color, isDark} = useTheme()

return (
<TextInput
Expand All @@ -228,6 +228,7 @@ const InputSearch = ({placeholder}: Props) => {
style={{flex: 1, color: color.el_gray_max}}
testID="inputSearch"
placeholderTextColor={color.text_gray_medium}
keyboardAppearance={isDark ? 'dark' : 'light'}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const MnemonicWordInput = React.forwardRef<MnemonicWordInputRef, MnemonicWordInp
const inputRef = React.useRef<RNTextInput>(null)
const {styles, colors} = useStyles()
const [word, setWord] = React.useState(selectedWord)
const {isDark} = useTheme()

React.useImperativeHandle(
ref,
Expand Down Expand Up @@ -311,6 +312,7 @@ const MnemonicWordInput = React.forwardRef<MnemonicWordInputRef, MnemonicWordInp
cursorColor={colors.primary_600} // only works for android
selectionColor={Platform.OS === 'android' ? colors.gray_100 : undefined} // on ios, selectionColor changes cursor and selection
keyboardType={Platform.OS === 'android' ? 'visible-password' : undefined} // to hide keyboard suggestions on android
keyboardAppearance={isDark ? 'dark' : 'light'} // ios feature
/>
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const TextInput = React.forwardRef((props: TextInputProps, ref: React.For
const [errorTextEnabled, setErrorTextEnabled] = React.useState(errorOnMount)
const [isValidWord, setIsValidWord] = React.useState(false)
const {colors} = useStyles()
const {isDark} = useTheme()

useDebounced(
React.useCallback(() => setErrorTextEnabled(true), []),
Expand Down Expand Up @@ -148,6 +149,7 @@ export const TextInput = React.forwardRef((props: TextInputProps, ref: React.For
{...inputProps}
cursorColor={cursorColor}
selectionColor={selectionColor}
keyboardAppearance={isDark ? 'dark' : 'light'} // ios feature
style={[
style,
renderComponentStyle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {ConfirmTxWithHwModal} from '../../../../../components/ConfirmTxWithHwMod
import {ConfirmTxWithOsModal} from '../../../../../components/ConfirmTxWithOsModal'
import {ConfirmTxWithSpendingPasswordModal} from '../../../../../components/ConfirmTxWithSpendingPasswordModal'
import {PairedBalance} from '../../../../../components/PairedBalance/PairedBalance'
import {Space} from '../../../../../components/Space/Space'
import {useMetrics} from '../../../../../kernel/metrics/metricsManager'
import {useUnsafeParams} from '../../../../../kernel/navigation'
import {Amounts} from '../../../../../yoroi-wallets/utils'
Expand Down Expand Up @@ -130,6 +131,8 @@ export const ConfirmTxScreen = () => {

return (
<View style={styles.root}>
<Space height="lg" />

<Text style={styles.secondaryText}>{title}</Text>

<Spacer height={4} />
Expand Down Expand Up @@ -239,7 +242,7 @@ const useStyles = () => {
},
secondaryText: {
...atoms.body_2_md_regular,
color: color.text_gray_medium,
color: color.text_gray_low,
},
row: {
...atoms.flex_row,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const AmountCard = ({
const [isFocused, setIsFocused] = React.useState(false)
const strings = useStrings()
const {styles, colors} = useStyles()
const {isDark} = useTheme()

const noTokenSelected = !touched
const info = amount?.info
Expand Down Expand Up @@ -80,6 +81,7 @@ export const AmountCard = ({
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
testID={`${testId}-amount-input`}
keyboardAppearance={isDark ? 'dark' : 'light'} // ios feature
{...(!info && {onPressIn: navigateTo})}
/>
</Pressable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const EditPrice = () => {
const strings = useStrings()
const [isFocused, setIsFocused] = React.useState(false)
const {styles, colors} = useStyles()
const {isDark} = useTheme()

const {orderData} = useSwap()
const sellTokenInfo = orderData.amounts.sell?.info
Expand Down Expand Up @@ -58,6 +59,7 @@ export const EditPrice = () => {
ref={limitInputRef}
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
keyboardAppearance={isDark ? 'dark' : 'light'} // ios feature
/>

<View style={[styles.textWrapper, disabled && styles.disabled]}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import * as React from 'react'
import Svg, {Path, SvgProps} from 'react-native-svg'
import Svg, {Path} from 'react-native-svg'

export const SupportIllustration = (props: SvgProps) => {
type Props = {
color?: string
size?: number
}

export const SupportIllustration = ({color = '#4B6DDE', size = 20}: Props) => {
return (
<Svg width={20} height={21} viewBox="0 0 20 21" fill="none" {...props}>
<Svg width={size} height={size} viewBox="0 0 20 21" fill="none">
<Path
fillRule="evenodd"
clipRule="evenodd"
d="M4.343 4.843A8 8 0 0118 10.5v1h-2a3 3 0 00-3 3v3a3 3 0 003 3h1a3 3 0 003-3v-7a10 10 0 00-20 0v7a3 3 0 003 3h1a3 3 0 003-3v-3a3 3 0 00-3-3H2v-1a8 8 0 012.343-5.657zM2 13.5v4a1 1 0 001 1h1a1 1 0 001-1v-3a1 1 0 00-1-1H2zm16 0h-2a1 1 0 00-1 1v3a1 1 0 001 1h1a1 1 0 001-1v-4z"
fill="#4B6DDE"
fill={color}
/>
</Svg>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ const linkToSupportOpenTicket = 'https://emurgohelpdesk.zendesk.com/hc/en-us/req
const SupportTicketLink = () => {
const onPress = () => Linking.openURL(linkToSupportOpenTicket)
const strings = useStrings()
const {styles} = useStyles()
const {styles, colors} = useStyles()

return (
<TouchableOpacity style={styles.link} onPress={onPress}>
<SupportIllustration />
<SupportIllustration color={colors.blue} />

<Space width="sm" />

Expand Down Expand Up @@ -165,7 +165,8 @@ const useStyles = () => {
backgroundColor: color.primary_500,
},
linkText: {
color: color.primary_500,
...atoms.button_2_md,
color: color.text_primary_medium,
},
link: {
...atoms.button_2_md,
Expand All @@ -182,6 +183,7 @@ const useStyles = () => {
})

const colors = {
blue: color.text_primary_medium,
gray: color.gray_600,
lightGray: color.gray_200,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,32 @@ export const WalletListItem = ({walletMeta, onPress}: Props) => {
<Space width="md" />

{isSelected && <Icon.Check size={20} color={colors.selected} />}

<Space width="md" />
</>
)}

{isButtonPressed ? <ChevronRightDarkIllustration /> : <ChevronRightGrayIllustration />}
<Space width="xl" />

<Chevron pressed={isButtonPressed} />
</TouchableOpacity>
</View>
</Swipeable>
)
}

const Chevron = ({pressed}: {pressed: boolean}) => {
const {styles} = useStyles()

return (
<View style={styles.chevron}>
<Space height="sm" />

{pressed ? <ChevronRightDarkIllustration /> : <ChevronRightGrayIllustration />}

<Space fill />
</View>
)
}

const getImplementationName = (walletMeta: Wallet.Meta) => {
if (isByron(walletMeta.implementation)) return 'Byron'
if (isShelley(walletMeta.implementation)) return 'Shelley'
Expand All @@ -148,26 +162,26 @@ const useStyles = () => {
const {atoms, color} = useTheme()
const styles = StyleSheet.create({
item: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
flexWrap: 'wrap',
...atoms.flex_row,
...atoms.justify_between,
...atoms.align_center,
...atoms.flex_wrap,
},
leftSide: {
flexDirection: 'row',
alignItems: 'center',
...atoms.flex_row,
...atoms.align_center,
},
walletDetails: {
justifyContent: 'space-between',
flex: 1,
...atoms.justify_between,
...atoms.flex_1,
},
walletName: {
...atoms.flex_1,
...atoms.body_1_lg_medium,
color: color.gray_max,
flex: 1,
color: color.text_gray_medium,
},
walletMeta: {
color: color.gray_600,
color: color.text_gray_low,
opacity: 0.5,
},
walletMetaPressed: {
Expand All @@ -178,13 +192,13 @@ const useStyles = () => {
opacity: 0.5,
},
rightContainer: {
justifyContent: 'center',
alignItems: 'center',
...atoms.justify_center,
...atoms.align_center,
width: 100,
},
rigthActionsContainer: {
justifyContent: 'center',
alignItems: 'center',
...atoms.justify_center,
...atoms.align_center,
...atoms.px_md,
},
actionDangerousText: {
Expand All @@ -193,6 +207,10 @@ const useStyles = () => {
...atoms.p_sm,
backgroundColor: color.sys_magenta_100,
},
chevron: {
...atoms.flex_col,
...atoms.align_start,
},
})

const colors = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
"defaultMessage": "!!!Select token",
"file": "src/features/Swap/common/AmountCard/AmountCard.tsx",
"start": {
"line": 132,
"line": 134,
"column": 15,
"index": 4163
"index": 4269
},
"end": {
"line": 135,
"line": 137,
"column": 3,
"index": 4246
"index": 4352
}
},
{
"id": "swap.swapScreen.currentBalance",
"defaultMessage": "!!!Current Balance",
"file": "src/features/Swap/common/AmountCard/AmountCard.tsx",
"start": {
"line": 136,
"line": 138,
"column": 18,
"index": 4266
"index": 4372
},
"end": {
"line": 139,
"line": 141,
"column": 3,
"index": 4355
"index": 4461
}
}
]
Loading
Loading