From b3749907411b9130de45218d5576da1342fa8433 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 5 Feb 2021 16:44:03 -0500 Subject: new modal done --- src/components/common/SocialLinkModal.tsx | 128 +++++++++++++++--------------- 1 file changed, 65 insertions(+), 63 deletions(-) (limited to 'src/components/common') diff --git a/src/components/common/SocialLinkModal.tsx b/src/components/common/SocialLinkModal.tsx index 85445155..be3221ee 100644 --- a/src/components/common/SocialLinkModal.tsx +++ b/src/components/common/SocialLinkModal.tsx @@ -1,25 +1,30 @@ import React from 'react'; -import {TouchableOpacity} from 'react-native'; -import {Modal, StyleSheet, Text, TouchableHighlight, View, ViewProps} from 'react-native'; +import {Modal, StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import {TextInput} from 'react-native-gesture-handler'; -import { TAGG_LIGHT_BLUE } from '../../constants'; -import {SCREEN_WIDTH} from '../../utils'; +import {SocialIcon} from '.'; import CloseIcon from '../../assets/ionicons/close-outline.svg'; +import {normalize, SCREEN_WIDTH} from '../../utils'; +import TaggSquareButton from './TaggSquareButton'; interface SocialLinkModalProps { + social: string; modalVisible: boolean; setModalVisible: (_: boolean) => void; completionCallback: (username: string) => void; - close: () => void; } const SocialLinkModal: React.FC = ({ + social, modalVisible, setModalVisible, - close, completionCallback, }) => { const [username, setUsername] = React.useState(''); + + const onClosePress = () => { + setModalVisible(false); + }; + return ( <> @@ -30,40 +35,38 @@ const SocialLinkModal: React.FC = ({ onRequestClose={() => {}}> - - Insert your snapchat username to link your snapchat account to your profile! + + + + + {social} + + Insert your {social.toLowerCase()} username to link your{' '} + {social.toLowerCase()} account to your profile! - {/* link button */} - { - setModalVisible(!modalVisible); - setUsername(''); - completionCallback(username); - }}> - Submit - - {/* cancel button */} - - - - {/* { - setUsername(''); - setModalVisible(!modalVisible); + if (username !== '') { + setModalVisible(!modalVisible); + setUsername(''); + completionCallback(username); + } }} - style={styles.cancelStyle}> - Cancel - */} + mode={'gradient'} + color={'white'} + /> @@ -77,14 +80,12 @@ const styles = StyleSheet.create({ flex: 1, justifyContent: 'center', alignItems: 'center', - marginTop: 22, }, modalView: { - width: (SCREEN_WIDTH * 2) / 3, - margin: 20, + width: SCREEN_WIDTH * 0.8, backgroundColor: 'white', - borderRadius: 20, - padding: 35, + borderRadius: 5, + padding: '10%', alignItems: 'center', shadowColor: '#000', shadowOffset: { @@ -95,40 +96,41 @@ const styles = StyleSheet.create({ shadowRadius: 3.84, elevation: 5, }, - openButton: { - borderRadius: 20, - padding: 10, - elevation: 2, - backgroundColor: '#2196F3', - }, - textStyle: { - color: 'white', - fontWeight: 'bold', + textInput: { + marginTop: '8%', + width: '85%', + paddingBottom: '2%', + borderBottomWidth: 0.4, + borderBottomColor: '#C4C4C4', + fontSize: normalize(20), textAlign: 'center', + fontWeight: '500', }, closeButton: { position: 'absolute', - height: '50%', - aspectRatio: 1, - left: '3%', + height: normalize(20), + width: normalize(20), + left: '5%', + top: '5%', }, - // cancelStyle: { - // position: 'absolute', - // height: 17, - // // fontStyle: 'normal', - // // fontWeight: '500', - // // fontSize: 14, - // /* identical to box height */ - // left: '3%', - // // textAlign: 'center', - // // color: TAGG_LIGHT_BLUE, - // }, - textInput: { - height: 20, - width: '75%', - borderBottomWidth: 0.4, - borderBottomColor: '#C4C4C4', - marginBottom: 20, + icon: { + top: -(normalize(70) / 3), + height: normalize(70), + width: normalize(70), + borderRadius: 30, + position: 'absolute', + }, + titleLabel: { + marginTop: '8%', + fontSize: normalize(17), + fontWeight: '600', + }, + descriptionLabel: { + marginTop: '3%', + fontSize: normalize(11), + fontWeight: '600', + textAlign: 'center', + color: '#828282', }, }); -- cgit v1.2.3-70-g09d2