Skip to content
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: 2 additions & 0 deletions apps/mobile/src/components/core/PWButton/PWButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type PWButtonProps = {
| 'secondary'
| 'helper'
| 'link'
| 'linkPositive'
| 'destructive'
| 'destructiveLight'
| 'errorLink'
Expand All @@ -44,6 +45,7 @@ const ICON_VARIANT_MAP: Record<string, PWIconVariant> = {
secondary: 'primary',
helper: 'helper',
link: 'link',
linkPositive: 'positive',
destructive: 'white',
destructiveLight: 'error',
errorLink: 'error',
Expand Down
4 changes: 4 additions & 0 deletions apps/mobile/src/components/core/PWButton/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export const useStyles = makeStyles((theme, props: PWButtonProps) => {
backgroundColor: theme.colors.background,
color: theme.colors.linkPrimary,
},
linkPositive: {
backgroundColor: theme.colors.background,
color: theme.colors.positive,
},
errorLink: {
backgroundColor: theme.colors.background,
color: theme.colors.alertNegative,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const SwapConfigurationBottomSheet = ({
}
right={
<PWButton
variant='link'
variant='linkPositive'
title={t('swap.configuration.apply')}
onPress={handleApply}
isDisabled={!isApplyEnabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const SwapFormControls = ({
<PWIcon
name='sliders'
size='sm'
variant='link'
variant='positive'
/>
</PWTouchableOpacity>
<PWView style={styles.maxDivider} />
Expand All @@ -63,7 +63,7 @@ export const SwapFormControls = ({
testID='swap-max-button'
>
<PWText
variant='link'
variant='linkPositive'
style={styles.maxText}
>
{t('swap.form.max')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { makeStyles } from '@rneui/themed'

export const useStyles = makeStyles(theme => {
const maxText = {
color: theme.colors.linkPrimary,
lineHeight: theme.spacing.lg,
}
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
PWView,
} from '@components/core'
import { Trans } from 'react-i18next'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { useLanguage } from '@hooks/useLanguage'
import { useWebView } from '@modules/webview'
import { config } from '@perawallet/wallet-core-config'
Expand All @@ -36,7 +37,8 @@ export const SwapIntroduction = ({
onStartSwapping,
onClose,
}: SwapIntroductionProps) => {
const styles = useStyles()
const insets = useSafeAreaInsets()
const styles = useStyles(insets)
const { t } = useLanguage()
const { pushWebView } = useWebView()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
*/

import { makeStyles } from '@rneui/themed'
import { EdgeInsets } from 'react-native-safe-area-context'

export const useStyles = makeStyles(theme => ({
export const useStyles = makeStyles((theme, insets: EdgeInsets) => ({
sheetContainer: {
paddingBottom: theme.spacing.xxl,
paddingBottom: insets.bottom,
},
heroSection: {
backgroundColor: theme.colors.modalityBg,
Expand All @@ -25,15 +26,15 @@ export const useStyles = makeStyles(theme => ({
},
contentSection: {
paddingHorizontal: theme.spacing.xl,
paddingTop: theme.spacing['3xl'],
paddingTop: theme.spacing.xxl,
gap: theme.spacing.lg,
},
title: {
color: theme.colors.textMain,
},
description: {
color: theme.colors.textGray,
marginBottom: theme.spacing['3xl'],
marginBottom: theme.spacing.xl,
},
poweredBy: {
color: theme.colors.textGrayLighter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const SwapPairHistoryWidget = () => {
{t('swap.history.widget.title')}
</PWText>
<PWButton
variant='link'
variant='linkPositive'
paddingStyle='none'
title={t('swap.history.widget.see_all')}
onPress={handleSeeAllPress}
Expand All @@ -122,6 +122,7 @@ export const SwapPairHistoryWidget = () => {
data={pairs}
renderItem={renderPair}
keyExtractor={keyExtractor}
style={styles.list}
contentContainerStyle={styles.listContent}
/>
</PWView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,25 @@ export const useStyles = makeStyles(theme => ({
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingHorizontal: theme.spacing.md,
},
title: {
color: theme.colors.textMain,
},
list: {
marginHorizontal: -theme.spacing.sm,
},
listContent: {
gap: theme.spacing.sm,
paddingRight: theme.spacing.md,
paddingHorizontal: theme.spacing.lg,
},
chip: {
flexDirection: 'row',
alignItems: 'center',
gap: theme.spacing.sm,
paddingVertical: theme.spacing.sm,
paddingHorizontal: theme.spacing.md,
borderRadius: theme.spacing.xl,
borderRadius: theme.spacing.lg,
backgroundColor: theme.colors.layerGrayLightest,
},
skeleton: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const SwapProviderBottomSheet = ({
onPress={handleApply}
testID='swap-provider-apply'
>
<PWText style={styles.applyText}>
<PWText variant='linkPositive'>
{t('swap.provider.apply')}
</PWText>
</PWTouchableOpacity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
import { makeStyles } from '@rneui/themed'

export const useStyles = makeStyles(theme => ({
applyText: {
color: theme.colors.linkPrimary,
},
list: {
paddingHorizontal: theme.spacing.lg,
paddingVertical: theme.spacing.md,
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/theme/typography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type TypographyVariant =
| 'bodySemibold'
| 'caption'
| 'link'
| 'linkPositive'
| 'mono'

export const getTypography = (
Expand Down Expand Up @@ -102,6 +103,13 @@ export const getTypography = (
color: theme.colors.linkPrimary,
fontWeight: 500,
},
linkPositive: {
fontFamily: getFontFamily(500),
fontSize: 13,
lineHeight: 24,
color: theme.colors.positive,
fontWeight: 500,
},
mono: {
fontFamily: getMonoFontFamily(400),
fontSize: 13,
Expand Down
Loading