diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/common/TaggSquareButton.tsx | 17 | ||||
| -rw-r--r-- | src/components/moments/MomentPostButton.tsx | 49 | ||||
| -rw-r--r-- | src/components/moments/index.ts | 1 |
3 files changed, 12 insertions, 55 deletions
diff --git a/src/components/common/TaggSquareButton.tsx b/src/components/common/TaggSquareButton.tsx index 1a1c33b3..2447276d 100644 --- a/src/components/common/TaggSquareButton.tsx +++ b/src/components/common/TaggSquareButton.tsx @@ -1,11 +1,12 @@ import React from 'react'; import { GestureResponderEvent, + StyleProp, StyleSheet, Text, TextStyle, TouchableOpacity, - ViewProps, + TouchableOpacityProps, ViewStyle, } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; @@ -15,14 +16,15 @@ import { TAGG_PURPLE, } from '../../constants'; import {normalize, SCREEN_WIDTH} from '../../utils'; -interface TaggSquareButtonProps extends ViewProps { + +interface TaggSquareButtonProps extends TouchableOpacityProps { onPress: (event: GestureResponderEvent) => void; title: string; buttonStyle: 'normal' | 'large' | 'gradient'; buttonColor: 'purple' | 'white' | 'blue'; labelColor: 'white' | 'blue'; - style?: ViewStyle; - labelStyle?: TextStyle; + style?: StyleProp<ViewStyle>; + labelStyle?: StyleProp<TextStyle>; } const TaggSquareButton: React.FC<TaggSquareButtonProps> = (props) => { @@ -50,6 +52,7 @@ const TaggSquareButton: React.FC<TaggSquareButtonProps> = (props) => { case 'large': return ( <TouchableOpacity + {...props} onPress={props.onPress} style={[styles.largeButton, buttonColor, props.style]}> <Text style={[styles.largeLabel, labelColor, props.labelStyle]}> @@ -59,7 +62,10 @@ const TaggSquareButton: React.FC<TaggSquareButtonProps> = (props) => { ); case 'gradient': return ( - <TouchableOpacity onPress={props.onPress} style={props.style}> + <TouchableOpacity + {...props} + onPress={props.onPress} + style={props.style}> <LinearGradient style={styles.gradientButton} colors={BACKGROUND_GRADIENT_MAP[0]} @@ -75,6 +81,7 @@ const TaggSquareButton: React.FC<TaggSquareButtonProps> = (props) => { default: return ( <TouchableOpacity + {...props} onPress={props.onPress} style={[styles.normalButton, buttonColor, props.style]}> <Text style={[styles.normalLabel, labelColor, props.labelStyle]}> diff --git a/src/components/moments/MomentPostButton.tsx b/src/components/moments/MomentPostButton.tsx deleted file mode 100644 index 78fe209b..00000000 --- a/src/components/moments/MomentPostButton.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; -import {StyleSheet} from 'react-native'; -import {Text} from 'react-native-animatable'; -import {TouchableOpacity} from 'react-native-gesture-handler'; -import {TAGG_LIGHT_BLUE} from '../../constants'; -import {normalize, SCREEN_WIDTH} from '../../utils'; - -interface MomentPostButtonProps { - enabled: boolean; - onPress: () => void; -} - -const MomentPostButton: React.FC<MomentPostButtonProps> = ({ - enabled, - onPress, -}) => { - return ( - <TouchableOpacity - style={[styles.button, enabled ? {} : styles.grey]} - onPress={onPress} - disabled={!enabled}> - <Text style={styles.text}>Post</Text> - </TouchableOpacity> - ); -}; - -const styles = StyleSheet.create({ - button: { - width: SCREEN_WIDTH * 0.8, - height: normalize(37), - backgroundColor: TAGG_LIGHT_BLUE, - justifyContent: 'center', - alignItems: 'center', - borderRadius: 6, - alignSelf: 'center', - }, - grey: { - backgroundColor: '#C4C4C4', - }, - text: { - color: 'white', - fontWeight: 'bold', - fontSize: normalize(15), - lineHeight: 18, - letterSpacing: 2, - }, -}); - -export default MomentPostButton; diff --git a/src/components/moments/index.ts b/src/components/moments/index.ts index d2f5d150..cac2da2e 100644 --- a/src/components/moments/index.ts +++ b/src/components/moments/index.ts @@ -3,4 +3,3 @@ export {default as CaptionScreenHeader} from './CaptionScreenHeader'; export {default as Moment} from './Moment'; export {default as TagFriendsFooter} from './TagFriendsFoooter'; export {default as MomentPost} from './MomentPost'; -export {default as MomentPostButton} from './MomentPostButton'; |
