Skip to content

Commit

Permalink
Merge pull request #1031 from ambrosus/AMB-5356
Browse files Browse the repository at this point in the history
refactor(ui): update stake info components with inline styling and consistent typography
  • Loading branch information
ArturHoncharuk authored Jan 28, 2025
2 parents fd6df30 + 5f2e6e2 commit 4bd040d
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 36 deletions.
46 changes: 37 additions & 9 deletions src/features/harbor/components/base/stake-info-container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,51 @@ export const StakeInfoContainer = ({
<Spacer value={scale(15)} />
<View style={styles.infoMain}>
<Row justifyContent={'space-between'}>
<Text style={styles.infoTitleText}>{t('harbor.apr')}</Text>
<Text style={styles.aprText}>{harborAPR} %</Text>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral600}
>
{t('harbor.apr')}
</Text>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.success500}
>
{harborAPR} %
</Text>
</Row>
<Spacer value={scale(8)} />
<Row justifyContent={'space-between'}>
<Text style={styles.infoTitleText}>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral600}
>
{t('harbor.total.staked')}
</Text>
<Text style={styles.intoText}>{totalAMBStaked} AMB</Text>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral900}
>
{totalAMBStaked} AMB
</Text>
</Row>
<Spacer value={scale(8)} />
<Row justifyContent={'space-between'}>
<Text style={styles.infoTitleText}>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral600}
>
{t('harbor.total.staked.value')}
</Text>
<Text style={styles.intoText}>
$ {NumberUtils.minimiseAmount(+totalStakedOnHarbor.usd)}
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral900}
>
${NumberUtils.minimiseAmount(+totalStakedOnHarbor.usd)}
</Text>
</Row>
</View>
Expand Down
14 changes: 2 additions & 12 deletions src/features/harbor/components/base/stake-info-container/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,7 @@ export const styles = StyleSheet.create({
infoMain: {
backgroundColor: COLORS.neutral100,
borderRadius: 16,
padding: scale(10)
},
infoTitleText: {
color: COLORS.neutral600,
fontSize: scale(14)
},
intoText: {
color: COLORS.neutral900,
fontSize: scale(14)
},
aprText: {
color: COLORS.success500
padding: scale(10),
rowGap: 12
}
});
15 changes: 13 additions & 2 deletions src/features/products/components/templates/products-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback } from 'react';
import { useCallback, useMemo } from 'react';
import {
SectionList,
SectionListData,
Expand Down Expand Up @@ -41,11 +41,22 @@ export const ProductsList = () => {
[]
);

const devSupportedProducts = useMemo(
() =>
PRODUCTS(t).map((section) => ({
...section,
data: section.data.filter(
(item) => !(!__DEV__ && item.route === 'BrowserScreen')
)
})),
[t]
);

return (
<SectionList<Product, SectionizedProducts>
bounces={false}
keyExtractor={(item) => item.id.toString()}
sections={PRODUCTS(t)}
sections={devSupportedProducts}
renderSectionHeader={renderSectionHeader}
renderItem={renderProductItem}
style={styles.container}
Expand Down
36 changes: 31 additions & 5 deletions src/screens/Harbor/ProcessStake/components/RateInfo/RateInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,44 @@ export const RateInfo = ({ availableToStake, rate = 1 }: RateInfoModel) => {
return (
<View style={styles.main}>
<Row justifyContent="space-between">
<Text style={styles.title}>{t('harbor.exchange.rate')}</Text>
<Text style={styles.text}>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral600}
>
{t('harbor.exchange.rate')}
</Text>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral900}
>
1 AMB = {rate}
{CryptoCurrencyCode.stAMB}
</Text>
</Row>
<Spacer value={scale(16)} />
<Row justifyContent="space-between">
<Text style={styles.title}>{t('harbor.stake.available')}</Text>
<Text style={styles.text}>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral600}
>
{t('harbor.stake.available')}
</Text>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral900}
>
{NumberUtils.minimiseAmount(+availableToStake)}{' '}
<Text color={COLORS.neutral600}>AMB</Text>
<Text
fontSize={14}
fontFamily="Inter_500Medium"
color={COLORS.neutral600}
>
AMB
</Text>
</Text>
</Row>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import { scale } from '@utils';
export const styles = StyleSheet.create({
main: {
...contentBox,
padding: scale(16),
backgroundColor: COLORS.neutral100
},
title: {
fontSize: scale(14),
color: COLORS.neutral600
},
text: {
fontSize: scale(12),
color: COLORS.neutral900
}
});

0 comments on commit 4bd040d

Please sign in to comment.