Skip to content

Commit

Permalink
fix ts
Browse files Browse the repository at this point in the history
  • Loading branch information
SorinC6 committed May 8, 2024
1 parent 0ba881b commit 7b36483
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {isNonNullable} from '@yoroi/common'
import {useTheme} from '@yoroi/theme'
import React, {ReactNode} from 'react'
import {ActivityIndicator, StyleSheet, TouchableOpacity, View} from 'react-native'
import LinearGradient from 'react-native-linear-gradient'

import {Icon, Spacer, Text} from '../../../../../components'
import {useTheme} from '@yoroi/theme'

type Props = {
title: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {useTheme} from '@yoroi/theme'
import React from 'react'
import {StyleSheet, View} from 'react-native'

import {Button, Spacer, Text} from '../../../../../components'
import {useNavigateTo, useStrings} from '../../common'
import {BrokenImage} from '../../illustrations'
import {useTheme} from '@yoroi/theme'

export const FailedTxScreen = () => {
const strings = useStrings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useStakingKeyState,
useVotingCertificate,
} from '@yoroi/staking'
import {useTheme} from '@yoroi/theme'
import React, {type ReactNode} from 'react'
import {StyleSheet, Text, View} from 'react-native'

Expand All @@ -30,7 +31,6 @@ import {Routes} from '../../common/navigation'
import {GovernanceImage} from '../../illustrations'
import {GovernanceVote} from '../../types'
import {EnterDrepIdModal} from '../EnterDrepIdModal'
import {useTheme} from '@yoroi/theme'

export const HomeScreen = () => {
const wallet = useSelectedWallet()
Expand Down Expand Up @@ -95,6 +95,7 @@ const ParticipatingInGovernanceVariant = ({
isTxPending?: boolean
}) => {
const strings = useStrings()
const styles = useStyles()
const navigateTo = useNavigateTo()
const {data: bech32DrepId} = useBech32DRepID(action.kind === 'delegate' ? action.drepID : '', {
enabled: action.kind === 'delegate',
Expand All @@ -108,8 +109,8 @@ const ParticipatingInGovernanceVariant = ({
const selectedActionTitle = actionTitles[action.kind]

const introduction = isTxPending
? strings.actionYouHaveSelectedTxPending(selectedActionTitle, formattingOptions)
: strings.actionYouHaveSelected(selectedActionTitle, formattingOptions)
? strings.actionYouHaveSelectedTxPending(selectedActionTitle, formattingOptions(styles))
: strings.actionYouHaveSelected(selectedActionTitle, formattingOptions(styles))

const navigateToChangeVote = () => {
navigateTo.changeVote()
Expand Down Expand Up @@ -168,13 +169,19 @@ const ParticipatingInGovernanceVariant = ({
)
}

const formattingOptions = {
b: (text: ReactNode) => <Text style={[styles.description, styles.bold]}>{text}</Text>,
textComponent: (text: ReactNode) => <Text style={styles.description}>{text}</Text>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const formattingOptions = (styles: any) => {
return {
b: (text: ReactNode) => {
return <Text style={[styles.description, styles.bold]}>{text}</Text>
},
textComponent: (text: ReactNode) => <Text style={styles.description}>{text}</Text>,
}
}

const NeverParticipatedInGovernanceVariant = () => {
const strings = useStrings()
const styles = useStyles()
const navigateTo = useNavigateTo()
const wallet = useSelectedWallet()
const {manager} = useGovernance()
Expand Down Expand Up @@ -328,6 +335,7 @@ const NeverParticipatedInGovernanceVariant = () => {

const HardwareWalletSupportComingSoon = () => {
const strings = useStrings()
const styles = useStyles()
const walletNavigateTo = useWalletNavigation()
const handleOnPress = () => walletNavigateTo.navigateToTxHistory()
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useFocusEffect} from '@react-navigation/native'
import {useTheme} from '@yoroi/theme'
import React from 'react'
import {StyleSheet, View} from 'react-native'

Expand All @@ -9,7 +10,6 @@ import {useNavigateTo, useStrings} from '../../common'
import {Routes} from '../../common/navigation'
import {SuccessTxImage} from '../../illustrations'
import {GovernanceKindMap} from '../../types'
import {useTheme} from '@yoroi/theme'

export const SuccessTxScreen = () => {
const strings = useStrings()
Expand Down

0 comments on commit 7b36483

Please sign in to comment.