Skip to content

Commit 24f6c60

Browse files
committed
Update AssetSettingsScene with proper margins and section headers
Add SceneContainer wrapper for 1rem margin convention (0.5rem container padding + 0.5rem element margin). Add section headers for token detection and asset settings. Use refresh icon instead of navigation chevron for the detect tokens action to indicate it performs an action rather than navigating to a new scene.
1 parent ae8a275 commit 24f6c60

2 files changed

Lines changed: 49 additions & 40 deletions

File tree

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default [
236236
'src/components/rows/PaymentMethodRow.tsx',
237237
'src/components/rows/SwapProviderRow.tsx',
238238
'src/components/rows/TxCryptoAmountRow.tsx',
239-
'src/components/scenes/AssetSettingsScene.tsx',
239+
240240
'src/components/scenes/ChangeMiningFeeScene.tsx',
241241

242242
'src/components/scenes/ConfirmScene.tsx',

src/components/scenes/AssetSettingsScene.tsx

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ import { useHandler } from '../../hooks/useHandler'
66
import { lstrings } from '../../locales/strings'
77
import { useSelector } from '../../types/reactRedux'
88
import type { EdgeAppSceneProps } from '../../types/routerTypes'
9+
import { EdgeCard } from '../cards/EdgeCard'
910
import { SceneWrapper } from '../common/SceneWrapper'
1011
import { CryptoIcon } from '../icons/CryptoIcon'
12+
import { SceneContainer } from '../layout/SceneContainer'
1113
import { showToast } from '../services/AirshipInstance'
1214
import { cacheStyles, type Theme, useTheme } from '../services/ThemeContext'
15+
import { SettingsRow } from '../settings/SettingsRow'
1316
import { SettingsTappableRow } from '../settings/SettingsTappableRow'
1417

1518
interface Props extends EdgeAppSceneProps<'assetSettings'> {}
1619

17-
export function AssetSettingsScene(props: Props) {
20+
export function AssetSettingsScene(props: Props): React.ReactElement {
1821
const { navigation } = props
1922
const theme = useTheme()
2023
const styles = getStyles(theme)
@@ -52,49 +55,55 @@ export function AssetSettingsScene(props: Props) {
5255

5356
return (
5457
<SceneWrapper scroll>
55-
<SettingsTappableRow
56-
key="detectTokens"
57-
label={lstrings.settings_detect_tokens}
58-
onPress={handleRescanTokens}
59-
>
60-
<FontAwesomeIcon
61-
style={styles.icon}
62-
name="refresh"
63-
size={theme.rem(1.25)}
64-
color={theme.iconTappable}
65-
/>
66-
</SettingsTappableRow>
67-
{CURRENCY_SETTINGS_KEYS.map(pluginId => {
68-
if (account.currencyConfig[pluginId] == null) return null
69-
const { currencyInfo } = account.currencyConfig[pluginId]
70-
const { displayName } = currencyInfo
71-
const onPress = () => {
72-
navigation.navigate('currencySettings', {
73-
currencyInfo
74-
})
75-
}
58+
<SceneContainer>
59+
<EdgeCard>
60+
<SettingsRow
61+
label={lstrings.settings_detect_tokens}
62+
onPress={handleRescanTokens}
63+
right={
64+
<FontAwesomeIcon
65+
name="refresh"
66+
size={theme.rem(1)}
67+
color={theme.iconTappable}
68+
style={styles.rightIcon}
69+
/>
70+
}
71+
/>
72+
</EdgeCard>
73+
<EdgeCard sections>
74+
{CURRENCY_SETTINGS_KEYS.map(pluginId => {
75+
if (account.currencyConfig[pluginId] == null) return null
76+
const { currencyInfo } = account.currencyConfig[pluginId]
77+
const { displayName } = currencyInfo
78+
const onPress = (): void => {
79+
navigation.navigate('currencySettings', {
80+
currencyInfo
81+
})
82+
}
7683

77-
return (
78-
<SettingsTappableRow
79-
key={pluginId}
80-
label={displayName}
81-
onPress={onPress}
82-
>
83-
<CryptoIcon
84-
marginRem={[0.5, 0, 0.5, 0.5]}
85-
pluginId={pluginId}
86-
tokenId={null}
87-
sizeRem={1.25}
88-
/>
89-
</SettingsTappableRow>
90-
)
91-
})}
84+
return (
85+
<SettingsTappableRow
86+
key={pluginId}
87+
label={displayName}
88+
onPress={onPress}
89+
>
90+
<CryptoIcon
91+
marginRem={[0.5, 0, 0.5, 0.5]}
92+
pluginId={pluginId}
93+
tokenId={null}
94+
sizeRem={1.25}
95+
/>
96+
</SettingsTappableRow>
97+
)
98+
})}
99+
</EdgeCard>
100+
</SceneContainer>
92101
</SceneWrapper>
93102
)
94103
}
95104

96105
const getStyles = cacheStyles((theme: Theme) => ({
97-
icon: {
98-
marginLeft: theme.rem(0.6)
106+
rightIcon: {
107+
marginHorizontal: theme.rem(0.5)
99108
}
100109
}))

0 commit comments

Comments
 (0)