Skip to content

Commit

Permalink
button refactor part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Sep 26, 2024
1 parent 159444a commit b4a777a
Show file tree
Hide file tree
Showing 102 changed files with 397 additions and 583 deletions.
5 changes: 1 addition & 4 deletions apps/wallet-mobile/src/components/Boundary/Boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {useQueryErrorResetBoundary} from 'react-query'

import image from '../../assets/img/error.png'
import {LocalizableError} from '../../kernel/i18n/LocalizableError'
import {Button} from '../Button/Button'
import {Button} from '../Button/NewButton'
import {Space} from '../Space/Space'
import {Spacer} from '../Spacer/Spacer'
import {Text} from '../Text'
Expand Down Expand Up @@ -133,7 +133,6 @@ const FullErrorFallback = ({error, resetErrorBoundary, reset = true, debug}: Err
{reset && (
<Button
title="Try again"
shelleyTheme
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
resetErrorBoundary()
Expand Down Expand Up @@ -163,7 +162,6 @@ const LargeErrorFallback = ({error, resetErrorBoundary, reset = true, debug}: Er
{reset && (
<Button
title="Try again"
shelleyTheme
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
resetErrorBoundary()
Expand All @@ -190,7 +188,6 @@ const SmallErrorFallback = ({error, resetErrorBoundary, reset = true, debug}: Er

{reset && (
<Button
shelleyTheme
title="Try again"
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
Expand Down
67 changes: 0 additions & 67 deletions apps/wallet-mobile/src/components/Button/Button.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Camera} from 'expo-camera'
import React from 'react'
import {Text, View} from 'react-native'

import {Button} from '../Button/Button'
import {Button} from '../Button/NewButton'
import {Spacer} from '../Spacer/Spacer'
import {CameraCodeScanner} from './CameraCodeScanner'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ storiesOf('ConfirmTx', module)
useUSB={false}
buttonProps={{
title: 'DELEGATE',
shelleyTheme: true,
}}
/>
</WalletManagerProviderMock>
Expand Down
3 changes: 1 addition & 2 deletions apps/wallet-mobile/src/components/ConfirmTx/ConfirmTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {useSubmitTx} from '../../yoroi-wallets/hooks'
import {withBLE, withUSB} from '../../yoroi-wallets/hw/hwWallet'
import {YoroiSignedTx, YoroiUnsignedTx} from '../../yoroi-wallets/types/yoroi'
import {delay} from '../../yoroi-wallets/utils/timeUtils'
import {Button, ButtonProps} from '../Button/Button'
import {Button, ButtonProps} from '../Button/NewButton'
import {ValidatedTextInput} from '../ValidatedTextInput'
import {Dialog, Step as DialogStep} from './Dialog'

Expand Down Expand Up @@ -290,7 +290,6 @@ export const ConfirmTx = ({
{...buttonProps}
disabled={isConfirmationDisabled || isProcessing || disabled}
testID="confirmTxButton"
shelleyTheme
/>
</View>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {useSelectedWallet} from '../../features/WalletManager/common/hooks/useSe
import {debugWalletInfo, features} from '../../kernel/features'
import {useSignTxWithPassword, useSubmitTx} from '../../yoroi-wallets/hooks'
import {YoroiSignedTx, YoroiUnsignedTx} from '../../yoroi-wallets/types/yoroi'
import {Button} from '../Button/Button'
import {Button} from '../Button/NewButton'
import {Spacer} from '../Spacer/Spacer'
import {Text} from '../Text'
import {Checkmark, TextInput} from '../TextInput/TextInput'
Expand Down Expand Up @@ -73,7 +73,6 @@ export const ConfirmTxWithSpendingPasswordModal = ({onSuccess, unsignedTx, onErr
<View style={styles.actions}>
<Button
testID="confirmButton"
shelleyTheme
title={strings.sign}
onPress={() => onSubmit?.(spendingPassword)}
disabled={spendingPassword.length === 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {BackHandler, Image, Platform, ScrollView, StyleSheet, Text, View} from '

import errorImage from '../../assets/img/error.png'
import {logger} from '../../kernel/logger/logger'
import {Button} from '../Button/Button'
import {Button} from '../Button/NewButton'
import {CopyButton} from '../CopyButton'
import {Spacer} from '../Spacer/Spacer'
import {ExpandableItem} from './ExpandableItem'
Expand Down Expand Up @@ -84,7 +84,7 @@ const ErrorView = ({state}: {state: State}) => {

{Platform.OS === 'android' && (
<View style={{padding: 16}}>
<Button shelleyTheme onPress={() => BackHandler.exitApp()} title="OK" style={{width: '100%'}} />
<Button onPress={() => BackHandler.exitApp()} title="OK" style={{width: '100%'}} />
</View>
)}
</View>
Expand Down
10 changes: 2 additions & 8 deletions apps/wallet-mobile/src/components/ErrorModal/ErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Image, LayoutAnimation, ScrollView, StyleSheet, Text, TouchableOpacity,
import image from '../../assets/img/error.png'
import globalMessages, {errorMessages} from '../../kernel/i18n/global-messages'
import {isEmptyString} from '../../kernel/utils'
import {Button} from '../Button/Button'
import {Button} from '../Button/NewButton'
import {Icon} from '../Icon'
import {Modal} from '../legacy/Modal/Modal'

Expand Down Expand Up @@ -63,13 +63,7 @@ export const ErrorView = ({title, errorMessage, errorLogs, onDismiss}: ErrorView
</View>
)}

<Button
block
shelleyTheme
onPress={onDismiss}
title={intl.formatMessage(globalMessages.close)}
testID="closeErrorModalButton"
/>
<Button onPress={onDismiss} title={intl.formatMessage(globalMessages.close)} testID="closeErrorModalButton" />
</ScrollView>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {StyleSheet} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'

import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode'
import {Button} from '../Button/Button'
import {Button} from '../Button/NewButton'
import {Spacer} from '../Spacer/Spacer'
import {Text} from '../Text'
import {HideableText} from './HideableText'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {action} from '@storybook/addon-actions'
import {storiesOf} from '@storybook/react-native'
import React from 'react'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {OsAuthScreen} from './OsAuthScreen'

storiesOf('OsAuthScreen', module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {defineMessages, useIntl} from 'react-intl'
import {StyleSheet, View} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {logger} from '../../../kernel/logger/logger'
import {useAuth} from '../AuthProvider'
import {useAuthWithOs} from '../common/hooks'
Expand All @@ -31,7 +31,7 @@ export const OsLoginScreen = () => {
</MiddleSection>

<BottomSection>
<Button title={strings.title} disabled={isLoading} shelleyTheme onPress={() => authWithOs()} />
<Button title={strings.title} disabled={isLoading} onPress={() => authWithOs()} />
</BottomSection>
</SafeAreaView>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'
import {defineMessages, useIntl} from 'react-intl'
import {StyleSheet, View} from 'react-native'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {PIN_LENGTH} from '../common/constants'
import {PinInput, PinInputRef} from './PinInput'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from 'react'
import {FlatList, Linking, Platform, StyleSheet, Text, TextProps, View, ViewProps} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {CopyButton} from '../../../components/CopyButton'
import {Icon} from '../../../components/Icon'
import {PressableIcon} from '../../../components/PressableIcon/PressableIcon'
Expand Down Expand Up @@ -55,7 +55,7 @@ export const ShowSuccessScreen = () => {
</>
)}

<Button onPress={navigateTo.back} title={strings.ok} shelleyTheme />
<Button onPress={navigateTo.back} title={strings.ok} />

<Spacer height={16} />
</Actions>
Expand Down
3 changes: 1 addition & 2 deletions apps/wallet-mobile/src/features/Dev/DeveloperScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {useIntl} from 'react-intl'
import {Alert, InteractionManager, SafeAreaView, ScrollView, StyleSheet, TouchableOpacity} from 'react-native'
import config from 'react-native-config'

import {Button} from '../../components/Button/Button'
import {Button} from '../../components/Button/NewButton'
import {Text} from '../../components/Text'
import {TextInput} from '../../components/TextInput/TextInput'
import {agreementDate} from '../../kernel/config'
Expand Down Expand Up @@ -193,7 +193,6 @@ export const DeveloperScreen = () => {
<Button
disabled={isLoading || addresses.split(',').length > 50 || addresses.length === 0}
style={styles.button}
shelleyTheme
onPress={() => {
storage
.keys('/wallet/', false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {storiesOf} from '@storybook/react-native'
import * as React from 'react'
import {View} from 'react-native'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {ConfirmConnectionModal, useOpenConfirmConnectionModal} from './ConfirmConnectionModal'

storiesOf('Discover ConfirmConnectionModal', module)
Expand Down Expand Up @@ -50,9 +50,9 @@ const WithButton = () => {

return (
<View>
<Button title="Open modal without warning" shelleyTheme onPress={handleOnPressNoWarning} />
<Button title="Open modal without warning" onPress={handleOnPressNoWarning} />

<Button title="Open modal with warning" shelleyTheme onPress={handleOnPressWarning} />
<Button title="Open modal with warning" onPress={handleOnPressWarning} />
</View>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Image} from 'expo-image'
import * as React from 'react'
import {Linking, StyleSheet, Text, View} from 'react-native'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {Icon} from '../../../components/Icon'
import {useModal} from '../../../components/Modal/ModalContext'
import {Space} from '../../../components/Space/Space'
Expand Down Expand Up @@ -110,7 +110,7 @@ export const ConfirmConnectionModal = ({name, website, onConfirm, logo, showSing

<Spacer height={46} />

<Button title={strings.confirmConnectionModalConnect} shelleyTheme onPress={onConfirm} />
<Button title={strings.confirmConnectionModalConnect} onPress={onConfirm} />
</View>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {useModal} from '../../../components/Modal/ModalContext'
import {Spacer} from '../../../components/Spacer/Spacer'
import {Text} from '../../../components/Text'
Expand Down Expand Up @@ -32,7 +32,7 @@ const HWNotSupportedModal = ({onConfirm}: Props) => {

<Spacer fill />

<Button title={strings.cancel} shelleyTheme onPress={onConfirm} />
<Button title={strings.cancel} onPress={onConfirm} />
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {storiesOf} from '@storybook/react-native'
import * as React from 'react'
import {View} from 'react-native'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {UnverifiedDappModal, useOpenUnverifiedDappModal} from './UnverifiedDappModal'

storiesOf('Discover UnverifiedDappModal', module)
Expand All @@ -25,5 +25,5 @@ const WithButton = () => {
})
}

return <Button title="Open Modal" shelleyTheme onPress={handleOnPress} />
return <Button title="Open Modal" onPress={handleOnPress} />
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react'
import {StyleSheet, Text, View} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'

import {Button} from '../../../components/Button/Button'
import {Button} from '../../../components/Button/NewButton'
import {useModal} from '../../../components/Modal/ModalContext'
import {Spacer} from '../../../components/Spacer/Spacer'
import {useStrings} from './useStrings'
Expand Down Expand Up @@ -46,7 +46,7 @@ export const UnverifiedDappModal = ({onConfirm}: Props) => {
<Spacer fill />

<View style={styles.actions}>
<Button title={strings.understand} shelleyTheme onPress={onConfirm} />
<Button title={strings.understand} onPress={onConfirm} />
</View>
</View>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {SafeAreaView} from 'react-native-safe-area-context'
import {useQuery} from 'react-query'
import {z} from 'zod'

import {Button} from '../../../../components/Button/Button'
import {Button} from '../../../../components/Button/NewButton'
import {CopyButton} from '../../../../components/CopyButton'
import {Icon} from '../../../../components/Icon'
import {ScrollView} from '../../../../components/ScrollView/ScrollView'
Expand Down Expand Up @@ -131,7 +131,7 @@ export const ReviewTransaction = () => {
</ScrollView>

<View style={[styles.buttonArea, {borderTopWidth: scrollbarShown ? 1 : 0}]}>
<Button title={strings.confirm} shelleyTheme onPress={handleOnConfirm} />
<Button title={strings.confirm} onPress={handleOnConfirm} />
</View>
</SafeAreaView>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Image, StyleSheet, Text, View} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'

import IllustrationDAppImage from '../../../../assets/img/illustration-dapp.png'
import {Button} from '../../../../components/Button/Button'
import {Button} from '../../../../components/Button/NewButton'
import {useModal} from '../../../../components/Modal/ModalContext'
import {useShowWelcomeDApp} from '../../common/useShowWelcomeDApp'
import {useStrings} from '../../common/useStrings'
Expand Down Expand Up @@ -73,7 +73,7 @@ const Modal = () => {
<Text style={styles.welcomeText}>{strings.welcomeToYoroiDAppExplorerDescription}</Text>

<View style={styles.actions}>
<Button shelleyTheme onPress={closeModal} title={strings.next} />
<Button onPress={closeModal} title={strings.next} />
</View>
</View>
)
Expand Down
Loading

0 comments on commit b4a777a

Please sign in to comment.