Skip to content

Commit

Permalink
Clickable headings
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Jul 15, 2024
1 parent 750d2a5 commit b08676e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import {useTheme} from '@yoroi/theme'
import * as React from 'react'
import {
FlatList,
Image,
StyleSheet,
Text,
TouchableOpacity,
TouchableOpacityProps,
useWindowDimensions,
View,
} from 'react-native'
import {FlatList, Image, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View} from 'react-native'

import nftPlaceholder from '../../../../../assets/img/nft-placeholder.png'
import {Icon, Spacer} from '../../../../../components'
Expand Down Expand Up @@ -68,22 +59,13 @@ type HeadingProps = {
onPress: () => void
}
const Heading = ({countNfts, onPress}: HeadingProps) => {
const {styles} = useStyles()
const {styles, colors} = useStyles()
const strings = useStrings()

return (
<View style={[styles.container, styles.actionsContainer]}>
<TouchableOpacity onPress={onPress} style={[styles.container, styles.actionsContainer]}>
<Text style={styles.title}>{strings.nfts(countNfts)}</Text>

<TouchNFTsList onPress={onPress} />
</View>
)
}

const TouchNFTsList = ({onPress}: TouchableOpacityProps) => {
const {colors} = useStyles()
return (
<TouchableOpacity onPress={onPress}>
<Icon.ArrowRight color={colors.gray_800} size={24} />
</TouchableOpacity>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import {isPrimaryToken} from '@yoroi/portfolio'
import {useTheme} from '@yoroi/theme'
import * as React from 'react'
import {
FlatList,
StyleSheet,
Text,
TouchableOpacity,
TouchableOpacityProps,
useWindowDimensions,
View,
} from 'react-native'
import {FlatList, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View} from 'react-native'

import {Icon, Spacer} from '../../../../../components'
import {makeList} from '../../../../../kernel/utils'
Expand Down Expand Up @@ -121,23 +113,13 @@ type HeadingProps = {
onPress: () => void
}
const Heading = ({countTokens, onPress, isFirstUser}: HeadingProps) => {
const {styles} = useStyles()
const {styles, colors} = useStyles()
const strings = useStrings()

return (
<View style={[styles.container, styles.actionsContainer]}>
<TouchableOpacity onPress={onPress} style={[styles.container, styles.actionsContainer]}>
<Text style={styles.title}>{strings.tokens(isFirstUser ? 0 : countTokens)}</Text>

<TouchTokensList onPress={onPress} />
</View>
)
}

const TouchTokensList = ({onPress}: TouchableOpacityProps) => {
const {colors} = useStyles()

return (
<TouchableOpacity onPress={onPress}>
<Icon.ArrowRight color={colors.gray_800} size={24} />
</TouchableOpacity>
)
Expand Down

0 comments on commit b08676e

Please sign in to comment.