11import * as React from "react" ;
2- import { Text , View , TouchableOpacity } from "react-native" ;
3- import Icon from "react-native-dynamic-vector-icons" ;
2+ import { Text , View , Image , TouchableOpacity } from "react-native" ;
43/**
54 * ? Local Imports
65 */
76import Card from "../Card/Card" ;
87import styles , { container } from "./BottomContainer.style" ;
98
10- interface IBottomContainerProps {
9+ export interface IBottomContainerProps {
1110 signupStyle ?: any ;
1211 signupText ?: string ;
1312 emailTitle ?: string ;
1413 cardState ?: boolean ;
15- IconComponent ?: any ;
1614 usernameTitle ?: string ;
1715 passwordTitle ?: string ;
1816 contentComponent ?: any ;
@@ -33,6 +31,7 @@ interface IBottomContainerProps {
3331 usernameTextInputValue ?: string ;
3432 passwordTextInputValue ?: string ;
3533 repasswordTextInputValue ?: string ;
34+ settingsIconComponent ?: React . ReactNode ;
3635 onSignUpPress ?: ( ) => void ;
3736 onPressSettings ?: ( ) => void ;
3837 emailOnChangeText ?: ( text : string ) => void ;
@@ -45,7 +44,6 @@ const BottomContainer = (props: IBottomContainerProps) => {
4544 const {
4645 cardState,
4746 onSignUpPress,
48- IconComponent,
4947 backgroundColor,
5048 onPressSettings,
5149 disableSettings,
@@ -58,39 +56,59 @@ const BottomContainer = (props: IBottomContainerProps) => {
5856 passwordIconComponent,
5957 usernameTextInputValue,
6058 passwordTextInputValue,
59+ settingsIconComponent,
6160 signupText,
6261 signupStyle,
6362 disableSignupButton,
6463 loginButtonText,
65- emailTitle,
6664 emailPlaceholder,
6765 emailOnChangeText,
6866 emailIconComponent,
6967 emailTextInputValue,
70- repasswordTitle,
7168 repasswordTextInputValue,
7269 repasswordPlaceholder,
7370 repasswordOnChangeText,
7471 repasswordIconComponent,
7572 } = props ;
7673
74+ const renderUserIcon = ( ) => (
75+ < Image
76+ source = { require ( "../../local-assets/user.png" ) }
77+ style = { styles . userIconImageStyle }
78+ />
79+ ) ;
80+
81+ const renderPasswordIcon = ( ) => (
82+ < Image
83+ source = { require ( "../../local-assets/password.png" ) }
84+ style = { styles . passwordIconImageStyle }
85+ />
86+ ) ;
87+
88+ const renderSettingsIcon = ( ) => (
89+ < View style = { styles . settingsIconContainer } >
90+ < Image
91+ source = { require ( "../../local-assets/settings.png" ) }
92+ style = { styles . settingsIconImageStyle }
93+ />
94+ </ View >
95+ ) ;
96+
7797 const renderLoginCards = ( ) => {
7898 return (
7999 < View >
80100 < Card
81101 value = { usernameTextInputValue }
82102 placeholder = { usernamePlaceholder }
83103 onChangeText = { usernameOnChangeText }
84- iconComponent = { usernameIconComponent }
104+ iconComponent = { usernameIconComponent || renderUserIcon ( ) }
85105 { ...props }
86106 />
87107 < Card
88- name = "key"
89108 secureTextEntry
90- type = "FontAwesome"
91109 value = { passwordTextInputValue }
92110 placeholder = { passwordPlaceholder }
93- iconComponent = { passwordIconComponent }
111+ iconComponent = { passwordIconComponent || renderPasswordIcon ( ) }
94112 onChangeText = { ( text : string ) =>
95113 passwordOnChangeText && passwordOnChangeText ( text )
96114 }
@@ -107,27 +125,23 @@ const BottomContainer = (props: IBottomContainerProps) => {
107125 value = { emailTextInputValue }
108126 placeholder = { emailPlaceholder }
109127 onChangeText = { emailOnChangeText }
110- iconComponent = { emailIconComponent }
128+ iconComponent = { emailIconComponent || renderUserIcon ( ) }
111129 { ...props }
112130 />
113131 < Card
114132 secureTextEntry
115133 value = { passwordTextInputValue }
116134 placeholder = { passwordPlaceholder }
117135 onChangeText = { passwordOnChangeText }
118- iconComponent = { passwordIconComponent }
119- name = "key"
120- type = "FontAwesome"
136+ iconComponent = { passwordIconComponent || renderPasswordIcon ( ) }
121137 { ...props }
122138 />
123139 < Card
124140 secureTextEntry
125141 value = { repasswordTextInputValue }
126142 placeholder = { repasswordPlaceholder }
127143 onChangeText = { repasswordOnChangeText }
128- iconComponent = { repasswordIconComponent }
129- name = "key"
130- type = "FontAwesome"
144+ iconComponent = { repasswordIconComponent || renderPasswordIcon ( ) }
131145 { ...props }
132146 />
133147 </ View >
@@ -146,15 +160,9 @@ const BottomContainer = (props: IBottomContainerProps) => {
146160 { ! disableSettings && (
147161 < TouchableOpacity
148162 onPress = { onPressSettings }
149- style = { { marginRight : "auto" } }
163+ style = { { marginRight : "auto" , marginLeft : 12 } }
150164 >
151- < IconComponent
152- size = { 35 }
153- type = "Ionicons"
154- name = "ios-settings"
155- color = "rgba(255,255,255, 0.9)"
156- { ...props }
157- />
165+ { settingsIconComponent || renderSettingsIcon ( ) }
158166 </ TouchableOpacity >
159167 ) }
160168 { ! disableSignupButton && (
@@ -165,6 +173,12 @@ const BottomContainer = (props: IBottomContainerProps) => {
165173 < Text style = { signupStyle || styles . signupTextStyle } >
166174 { cardState ? signupText : loginButtonText }
167175 </ Text >
176+ < View style = { styles . signupButtonRightArrowContainer } >
177+ < Image
178+ source = { require ( "../../local-assets/right-arrow.png" ) }
179+ style = { styles . signupButtonRightArrowImageStyle }
180+ />
181+ </ View >
168182 </ TouchableOpacity >
169183 ) }
170184 </ View >
@@ -173,7 +187,6 @@ const BottomContainer = (props: IBottomContainerProps) => {
173187} ;
174188
175189BottomContainer . defaultProps = {
176- IconComponent : Icon ,
177190 loginButtonText : "Already Have Account" ,
178191 disableSwitch : false ,
179192 disableSettings : false ,
@@ -184,7 +197,6 @@ BottomContainer.defaultProps = {
184197 usernamePlaceholder : "Username" ,
185198 passwordPlaceholder : "Password" ,
186199 repasswordPlaceholder : "Re-password" ,
187- backgroundColor : "rgba(255,255,255,0.45)" ,
188200} ;
189201
190202export default BottomContainer ;
0 commit comments