aboutsummaryrefslogtreecommitdiff
path: root/src/components/taggs
diff options
context:
space:
mode:
authorGeorge Rusu <george@tagg.id>2021-05-19 12:44:43 -0700
committerGeorge Rusu <george@tagg.id>2021-05-19 12:44:43 -0700
commit9c61216d0a64a259fc6a0180627c322b4f26ffea (patch)
tree3b086f037115538aa9619559046fec2cc8d2cc3c /src/components/taggs
parent1ae1359fc2a28230101817fe8037d6fd95e9109f (diff)
Create basic component and styling
Diffstat (limited to 'src/components/taggs')
-rw-r--r--src/components/taggs/TaggDraggable.tsx143
1 files changed, 65 insertions, 78 deletions
diff --git a/src/components/taggs/TaggDraggable.tsx b/src/components/taggs/TaggDraggable.tsx
index 2c7ae2ce..afd2a212 100644
--- a/src/components/taggs/TaggDraggable.tsx
+++ b/src/components/taggs/TaggDraggable.tsx
@@ -1,6 +1,13 @@
import {useNavigation} from '@react-navigation/native';
import React, {useState} from 'react';
-import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
+import {
+ Image,
+ StyleSheet,
+ Text,
+ TouchableOpacity,
+ TouchableWithoutFeedback,
+ View,
+} from 'react-native';
import Draggable from 'react-native-draggable';
import {ScreenType, UserType} from '../../types';
import {
@@ -12,6 +19,9 @@ import {
import TaggAvatar from '../profile/TaggAvatar';
import {RootState} from '../../store/rootReducer';
import {useStore, useDispatch} from 'react-redux';
+import {Button} from 'react-native-share';
+import {userBlockFetched} from 'src/store/reducers';
+import {color} from 'react-native-reanimated';
interface TaggDraggableProps {
draggable?: boolean;
@@ -43,94 +53,31 @@ const TaggDraggable: React.FC<TaggDraggableProps> = (
deleteFromList,
} = props;
let uriTip = require('../../assets/images/tagg-tip.png');
- let uriX = require('../../assets/images/tagg-x-button.png');
-
- // <Image style={styles.image} source={uri} />
+ let uriX = require('../../assets/images/draggableX.png');
- /**
- * This function returns x,y pairing for each tagg.
- */
- // const getCoords = () => {
- // return [xCoord, yCoord];
- // };
- const renderTagg = () => {
- return (
+ return (
+ <TouchableWithoutFeedback>
<View style={styles.container}>
- {/* user profile pic */}
- <TouchableOpacity style={styles.imageRectangle}>
+ <TouchableOpacity disabled={true} style={[styles.button]}>
<TaggAvatar
+ style={styles.avatar}
screenType={ScreenType.Profile}
editable={false}
userXId={undefined}
/>
- {/* @username */}
- <Text
- onPress={() =>
- navigateToProfile(
- state,
- dispatch,
- navigation,
- ScreenType.Profile,
- taggedUser,
- )
- }>
- {taggedUser.userId}
- </Text>
- {/* x button */}
- <Image style={styles.imageTip} source={uriTip} />
- <TouchableOpacity onPress={() => deleteFromList()}>
+ <Text style={styles.buttonTitle}>@{taggedUser.username}</Text>
+ <TouchableOpacity disabled={false}>
<Image style={styles.imageX} source={uriX} />
</TouchableOpacity>
</TouchableOpacity>
</View>
- );
- };
- if (redirect) {
- if (draggable) {
- return (
- <View style={styles.container}>
- {console.log("this guy's userid is: " + taggedUser.userId)}
- <Draggable
- minX={minX}
- minY={minY}
- maxX={maxX}
- maxY={maxY}
- onDragRelease={(_, gestureState) => {
- setXcoord(gestureState.moveX);
- setYcoord(gestureState.moveY);
- }}>
- <TouchableOpacity style={styles.imageRectangle}>
- <TaggAvatar
- screenType={ScreenType.Profile}
- editable={false}
- userXId={undefined}
- />
- <Text>{taggedUser.userId}</Text>
- <Image style={styles.imageTip} source={uriTip} />
- <TouchableOpacity onPress={() => deleteFromList()}>
- <Image style={styles.imageX} source={uriX} />
- </TouchableOpacity>
- </TouchableOpacity>
- </Draggable>
- <TouchableOpacity style={styles.imageRectangle}>
- <Text>{taggedUser.userId}</Text>
- <Image style={styles.imageTip} source={uriTip} />
- <TouchableOpacity onPress={() => deleteFromList()}>
- <Image style={styles.imageX} source={uriX} />
- </TouchableOpacity>
- </TouchableOpacity>
- </View>
- );
- } else {
- return renderTagg();
- }
- } else {
- return renderTagg();
- }
+ </TouchableWithoutFeedback>
+ );
};
const styles = StyleSheet.create({
container: {
+ color: 'red',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
@@ -138,16 +85,39 @@ const styles = StyleSheet.create({
marginBottom: '5%',
},
bodyContainer: {
+ color: 'blue',
flexDirection: 'column',
height: normalize(42),
justifyContent: 'space-around',
},
+ label: {
+ fontWeight: '500',
+ fontSize: normalize(14),
+ },
+ rectangle: {
+ width: 100 * 2,
+ height: 100,
+ borderRadius: 25,
+ paddingLeft: 10,
+ paddingBottom: 0,
+ paddingTop: 10,
+ },
+ buttonTitle: {
+ color: 'white',
+ fontSize: normalize(11),
+ fontWeight: '700',
+ lineHeight: normalize(13.13),
+ letterSpacing: normalize(0.6),
+ paddingHorizontal: '3.8%',
+ },
+ avatar: {
+ flex: 0.45,
+ aspectRatio: 1,
+ },
inviteButton: {
backgroundColor: 'transparent',
},
imageRectangle: {
- width: '100%',
- height: '100%',
backgroundColor: 'black',
borderWidth: 2,
borderRadius: 2,
@@ -156,8 +126,25 @@ const styles = StyleSheet.create({
backgroundColor: 'black',
},
imageX: {
- width: '100%',
- height: '100%',
+ width: normalize(15),
+ height: normalize(15),
+ },
+ pendingButtonTitle: {
+ color: 'white',
+ },
+ button: {
+ paddingLeft: 1,
+ paddingTop: 3,
+ paddingBottom: 3,
+ justifyContent: 'space-evenly',
+ alignSelf: 'flex-start',
+ alignItems: 'center',
+ borderWidth: 1.5,
+ borderRadius: 20,
+ flexDirection: 'row',
+ flexWrap: 'wrap',
+ borderColor: 'black',
+ backgroundColor: 'rgba(0, 0, 0, 0.8)',
},
});