-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[native] Extract the buttons from the logged out modal
Summary: These buttons will be used later in the stack. Use the primary buttons instead of the old styling. Before {F3407708} After {F3407706} Depends on D14064 Test Plan: Check if the logged out modal still looks correct. Reviewers: kamil, angelika, ashoat Reviewed By: ashoat Subscribers: ashoat Differential Revision: https://phab.comm.dev/D14066
- Loading branch information
Showing
3 changed files
with
124 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// @flow | ||
|
||
import * as React from 'react'; | ||
import { Text, View } from 'react-native'; | ||
|
||
import PrimaryButton from '../components/primary-button.react.js'; | ||
import { useStyles } from '../themes/colors.js'; | ||
import EthereumLogo from '../vectors/ethereum-logo.react.js'; | ||
|
||
type Props = { | ||
+text: string, | ||
+onPress: () => mixed, | ||
+variant: 'regular' | 'siwe', | ||
}; | ||
|
||
function PromptButton(props: Props): React.Node { | ||
const styles = useStyles(unboundStyles); | ||
|
||
const { text, onPress, variant } = props; | ||
if (variant === 'regular') { | ||
return ( | ||
<View style={styles.container}> | ||
<PrimaryButton onPress={onPress} label={text} /> | ||
</View> | ||
); | ||
} | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<PrimaryButton onPress={onPress} style={styles.siweButton}> | ||
<View style={styles.siweIcon}> | ||
<EthereumLogo /> | ||
</View> | ||
<Text style={styles.buttonText}>{text}</Text> | ||
</PrimaryButton> | ||
</View> | ||
); | ||
} | ||
|
||
const unboundStyles = { | ||
container: { flex: 1 }, | ||
buttonText: { | ||
fontSize: 18, | ||
textAlign: 'center', | ||
color: 'siweButtonText', | ||
}, | ||
siweButton: { | ||
backgroundColor: 'siweButton', | ||
flexDirection: 'row', | ||
justifyContent: 'center', | ||
padding: 12, | ||
}, | ||
siweIcon: { | ||
paddingRight: 10, | ||
}, | ||
}; | ||
|
||
export default PromptButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters