-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f0fab2
commit e36614e
Showing
7 changed files
with
248 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { MainWrapper } from "../../Layout/MainWrapper"; | ||
import { Dimensions, Pressable, TextInput, ToastAndroid, View } from "react-native"; | ||
import Animated, { FadeInDown } from "react-native-reanimated"; | ||
import FastImage from "react-native-fast-image"; | ||
import { Heading } from "../../Component/Global/Heading"; | ||
import { useState } from "react"; | ||
import { SetUserNameValue } from "../../LocalStorage/StoreUserName"; | ||
import { useTheme } from "@react-navigation/native"; | ||
import { PlainText } from "../../Component/Global/PlainText"; | ||
import { Spacer } from "../../Component/Global/Spacer"; | ||
|
||
export const ChangeName = ({navigation}) => { | ||
const width = Dimensions.get("window").width | ||
const theme = useTheme() | ||
const [Name, setName] = useState(""); | ||
async function OnConfirm(name){ | ||
if (name === ""){ | ||
// eslint-disable-next-line no-alert | ||
alert("Please Enter name!") | ||
} else { | ||
await SetUserNameValue(name.trim()) | ||
navigation.pop() | ||
ToastAndroid.showWithGravity( | ||
`Please restart the app`, | ||
ToastAndroid.SHORT, | ||
ToastAndroid.CENTER, | ||
); | ||
} | ||
} | ||
return ( | ||
<MainWrapper> | ||
<View style={{ | ||
alignItems:"center", | ||
justifyContent:"center", | ||
flex:1, | ||
}}> | ||
<Animated.View entering={FadeInDown.duration(500)}><FastImage source={require("../../Images/GiveName.gif")} style={{ | ||
height:200, | ||
width:200, | ||
borderRadius:100, | ||
}}/></Animated.View> | ||
<Animated.View entering={FadeInDown.delay(500)}><Heading text={"What should I call you?"} nospace={true} style={{marginTop:10}}/></Animated.View> | ||
<TextInput placeholderTextColor={theme.colors.text} value={Name} onChangeText={(text)=>{ | ||
setName(text) | ||
}} textAlign={'center'} placeholder={"Enter your name"} style={{ | ||
borderWidth:2, | ||
backgroundColor:"rgb(53,58,70)", | ||
borderRadius:10, | ||
padding:10, | ||
width:width * 0.5, | ||
color:theme.colors.text, | ||
}}/> | ||
<Spacer/> | ||
<Pressable onPress={()=>{ | ||
OnConfirm(Name) | ||
}} style={{ | ||
padding:10, | ||
alignItems:"center", | ||
justifyContent:'center', | ||
backgroundColor:theme.colors.primary, | ||
borderRadius:10, | ||
}}> | ||
<PlainText text={"Change Name"} style={{ | ||
color:"black", | ||
}}/> | ||
</Pressable> | ||
</View> | ||
</MainWrapper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import { MainWrapper } from "../../Layout/MainWrapper"; | ||
import { Pressable, ToastAndroid, View } from "react-native"; | ||
import Animated, { FadeInDown } from "react-native-reanimated"; | ||
import FastImage from "react-native-fast-image"; | ||
import { PlainText } from "../../Component/Global/PlainText"; | ||
import { EachCheckBox } from "../../Component/RouteOnboarding/EachCheckBox"; | ||
import { useState } from "react"; | ||
import { SetLanguageValue } from "../../LocalStorage/Languages"; | ||
import { useTheme } from "@react-navigation/native"; | ||
import { Spacer } from "../../Component/Global/Spacer"; | ||
|
||
export const SelectLanguages = ({navigation}) => { | ||
const [Languages, setLanguages] = useState([]); | ||
const theme = useTheme() | ||
async function onConfirmPress(language){ | ||
if (language.length < 2){ | ||
// eslint-disable-next-line no-alert | ||
alert("Please select atleast 2 language") | ||
} else { | ||
const Lang = language.join(",") | ||
await SetLanguageValue(Lang) | ||
navigation.pop() | ||
ToastAndroid.showWithGravity( | ||
`Please restart the app`, | ||
ToastAndroid.SHORT, | ||
ToastAndroid.CENTER, | ||
); | ||
} | ||
} | ||
return ( | ||
<MainWrapper> | ||
<View style={{ | ||
alignItems:"center", | ||
marginTop:10 | ||
}}> | ||
<Animated.View entering={FadeInDown.duration(500)}><FastImage source={require("../../Images/selectLanguage.gif")} style={{ | ||
height:150, | ||
width:150, | ||
borderRadius:100, | ||
}}/></Animated.View> | ||
<Spacer/> | ||
<Animated.View entering={FadeInDown.delay(750)}><PlainText text={"select atleast 2 language"}/></Animated.View> | ||
</View> | ||
<View style={{ | ||
flex:1, | ||
alignItems:"center", | ||
justifyContent:'flex-start', | ||
marginTop:10, | ||
}}> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(()=>data) | ||
}} checkbox1={"English"} checkbox2={"Hindi"} onCheck2={(data)=>{ | ||
setLanguages(()=>data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Punjabi"} checkbox2={"Tamil"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Telugu"} checkbox2={"Marathi"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Bhojpuri"} checkbox2={"Bengali"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Kannada"} checkbox2={"Gujarati"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Malayalam"} checkbox2={"Urdu"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Kannada"} checkbox2={"Rajasthani"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<EachCheckBox data={Languages} onCheck1={(data)=>{ | ||
setLanguages(data) | ||
}} checkbox1={"Odia"} checkbox2={"Assamese"} onCheck2={(data)=>{ | ||
setLanguages(data) | ||
}}/> | ||
<Spacer/> | ||
<Pressable onPress={()=>{ | ||
onConfirmPress((Languages)) | ||
}} style={{ | ||
padding:15, | ||
alignItems:"center", | ||
justifyContent:'center', | ||
backgroundColor:theme.colors.primary, | ||
borderRadius:10, | ||
}}> | ||
<PlainText text={"Confirm"} style={{ | ||
color:"black", | ||
paddingRight:0, | ||
}}/> | ||
</Pressable> | ||
</View> | ||
</MainWrapper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters