diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-09 19:55:26 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-09 19:55:26 -0400 |
commit | 0a480048b41a80e8569ce57064d1b9716c3d25e3 (patch) | |
tree | 4f1118560c10dcdfa32e99d2b73c3d7814d7904d /src/components/common | |
parent | 17de7d8312b10f84af2178f769ff92bf96ab47f5 (diff) | |
parent | 9d5ad9bea36c0b2abffd04b25126d18158017137 (diff) |
Merge branch 'master' into tma784-style-message-input
# Conflicts:
# src/screens/chat/ChatListScreen.tsx
# src/screens/chat/ChatScreen.tsx
Diffstat (limited to 'src/components/common')
-rw-r--r-- | src/components/common/AcceptDeclineButtons.tsx | 2 | ||||
-rw-r--r-- | src/components/common/BasicButton.tsx | 77 | ||||
-rw-r--r-- | src/components/common/FriendsButton.tsx | 2 | ||||
-rw-r--r-- | src/components/common/index.ts | 1 |
4 files changed, 80 insertions, 2 deletions
diff --git a/src/components/common/AcceptDeclineButtons.tsx b/src/components/common/AcceptDeclineButtons.tsx index 167148f0..7bb62fd4 100644 --- a/src/components/common/AcceptDeclineButtons.tsx +++ b/src/components/common/AcceptDeclineButtons.tsx @@ -58,7 +58,7 @@ const styles = StyleSheet.create({ backgroundColor: TAGG_LIGHT_BLUE, }, rejectButton: { - borderWidth: 1, + borderWidth: 2, backgroundColor: 'white', borderColor: TAGG_LIGHT_BLUE, }, diff --git a/src/components/common/BasicButton.tsx b/src/components/common/BasicButton.tsx new file mode 100644 index 00000000..1fe29cd9 --- /dev/null +++ b/src/components/common/BasicButton.tsx @@ -0,0 +1,77 @@ +import React from 'react'; +import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native'; +import {TAGG_LIGHT_BLUE} from '../../constants'; +import {TouchableOpacity} from 'react-native-gesture-handler'; +import {normalize} from '../../utils'; + +interface BasicButtonProps { + title: string; + onPress: () => void; + solid?: boolean; + externalStyles?: Record<string, StyleProp<ViewStyle>>; +} +const BasicButton: React.FC<BasicButtonProps> = ({ + title, + onPress, + solid, + externalStyles, +}) => { + return ( + <View style={[styles.container, externalStyles?.container]}> + <TouchableOpacity + style={[ + styles.genericButtonStyle, + solid ? styles.solidButton : styles.outlineButton, + ]} + onPress={onPress}> + <Text + style={[ + styles.buttonTitle, + solid + ? styles.solidButtonTitleColor + : styles.outlineButtonTitleColor, + ]}> + {title} + </Text> + </TouchableOpacity> + </View> + ); +}; + +const styles = StyleSheet.create({ + container: { + height: '100%', + flexDirection: 'column', + justifyContent: 'space-around', + }, + genericButtonStyle: { + justifyContent: 'center', + alignItems: 'center', + borderRadius: 3, + padding: 0, + width: '100%', + height: '100%', + }, + solidButton: { + padding: 0, + backgroundColor: TAGG_LIGHT_BLUE, + }, + outlineButton: { + borderWidth: 2, + backgroundColor: 'white', + borderColor: TAGG_LIGHT_BLUE, + }, + solidButtonTitleColor: { + color: 'white', + }, + outlineButtonTitleColor: { + color: TAGG_LIGHT_BLUE, + }, + buttonTitle: { + fontSize: normalize(15), + fontWeight: '700', + letterSpacing: 1, + }, +}); + +export default BasicButton; diff --git a/src/components/common/FriendsButton.tsx b/src/components/common/FriendsButton.tsx index 46421bd1..6ddad93f 100644 --- a/src/components/common/FriendsButton.tsx +++ b/src/components/common/FriendsButton.tsx @@ -100,7 +100,7 @@ const styles = StyleSheet.create({ button: { justifyContent: 'center', alignItems: 'center', - width: SCREEN_WIDTH * 0.4, + width: SCREEN_WIDTH * 0.42, aspectRatio: 154 / 33, borderWidth: 2, borderColor: TAGG_LIGHT_BLUE, diff --git a/src/components/common/index.ts b/src/components/common/index.ts index 8499dbfa..b5fd0542 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -23,3 +23,4 @@ export {default as AcceptDeclineButtons} from './AcceptDeclineButtons'; export {default as FriendsButton} from './FriendsButton'; export {default as TaggSquareButton} from './TaggSquareButton'; export {default as GradientBorderButton} from './GradientBorderButton'; +export {default as BasicButton} from './BasicButton'; |