|
@ -1,58 +1,68 @@ |
|
|
import React, { useState, Fragment } from "react"; |
|
|
import React, { useState, Fragment } from "react"; |
|
|
import { StyleSheet, View } from "react-native"; |
|
|
import { StyleSheet, View } from "react-native"; |
|
|
|
|
|
|
|
|
import { FontAwesome5 } from '@expo/vector-icons'; |
|
|
|
|
|
|
|
|
import { FontAwesome5 } from "@expo/vector-icons"; |
|
|
import colors from "../config/colors"; |
|
|
import colors from "../config/colors"; |
|
|
import SearchableDropdown from 'react-native-searchable-dropdown'; |
|
|
|
|
|
|
|
|
import SearchableDropdown from "react-native-searchable-dropdown"; |
|
|
|
|
|
|
|
|
const items = [ |
|
|
const items = [ |
|
|
//substituir posteriormente pelas escolas
|
|
|
//substituir posteriormente pelas escolas
|
|
|
{ |
|
|
{ |
|
|
id: 1, |
|
|
id: 1, |
|
|
name: 'JavaScript', |
|
|
|
|
|
|
|
|
name: "JavaScript", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 2, |
|
|
id: 2, |
|
|
name: 'Java', |
|
|
|
|
|
|
|
|
name: "Java", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 3, |
|
|
id: 3, |
|
|
name: 'Ruby', |
|
|
|
|
|
|
|
|
name: "Ruby", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 4, |
|
|
id: 4, |
|
|
name: 'React Native', |
|
|
|
|
|
|
|
|
name: "React Native", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 5, |
|
|
id: 5, |
|
|
name: 'PHP', |
|
|
|
|
|
|
|
|
name: "PHP", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 6, |
|
|
id: 6, |
|
|
name: 'Python', |
|
|
|
|
|
|
|
|
name: "Python", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 7, |
|
|
|
|
|
name: "Python", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 8, |
|
|
|
|
|
name: "Python", |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
id: 9, |
|
|
|
|
|
name: "Python", |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
function SchoolPicker(props) { |
|
|
function SchoolPicker(props) { |
|
|
const [selectedItems, setSelectedItems] = useState(null); |
|
|
const [selectedItems, setSelectedItems] = useState(null); |
|
|
|
|
|
|
|
|
const selected = ( i ) => { |
|
|
|
|
|
|
|
|
const selected = (i) => { |
|
|
setSelectedItems(i); |
|
|
setSelectedItems(i); |
|
|
props.itemSelected(i); |
|
|
props.itemSelected(i); |
|
|
//console.log(i.name);
|
|
|
//console.log(i.name);
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View style={{ flex: 1, width: "100%", marginTop: 10 }}> |
|
|
|
|
|
|
|
|
<View style={{ width: "100%" }}> |
|
|
<View style={styles.location}> |
|
|
<View style={styles.location}> |
|
|
<View style={styles.mapIcon}> |
|
|
<View style={styles.mapIcon}> |
|
|
<FontAwesome5 |
|
|
<FontAwesome5 |
|
|
name="university" |
|
|
name="university" |
|
|
size={28} |
|
|
|
|
|
color="white" |
|
|
|
|
|
alignItems="center" |
|
|
|
|
|
alignContent="center" |
|
|
|
|
|
|
|
|
size={30} |
|
|
|
|
|
color={colors.primary} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</View> |
|
|
<View style={styles.adressText}> |
|
|
<View style={styles.adressText}> |
|
@ -61,47 +71,38 @@ function SchoolPicker(props) { |
|
|
multi={false} |
|
|
multi={false} |
|
|
selectedItems={selectedItems} |
|
|
selectedItems={selectedItems} |
|
|
onItemSelect={(item) => { |
|
|
onItemSelect={(item) => { |
|
|
selected(item) |
|
|
|
|
|
|
|
|
selected(item); |
|
|
}} |
|
|
}} |
|
|
containerStyle={{ padding: 5 }} |
|
|
|
|
|
itemStyle={{ |
|
|
itemStyle={{ |
|
|
padding: 10, |
|
|
padding: 10, |
|
|
marginTop: 2, |
|
|
marginTop: 2, |
|
|
backgroundColor: '#ddd', |
|
|
|
|
|
borderColor: '#bbb', |
|
|
|
|
|
|
|
|
backgroundColor: "#fff", |
|
|
|
|
|
borderColor: "#bbb", |
|
|
borderWidth: 1, |
|
|
borderWidth: 1, |
|
|
borderRadius: 6, |
|
|
borderRadius: 6, |
|
|
width: "100%", |
|
|
width: "100%", |
|
|
}} itemTextStyle={{ color: '#222' }} |
|
|
|
|
|
|
|
|
}} |
|
|
|
|
|
itemTextStyle={{ color: "#222" }} |
|
|
itemsContainerStyle={{ maxHeight: "100%" }} |
|
|
itemsContainerStyle={{ maxHeight: "100%" }} |
|
|
items={items} |
|
|
items={items} |
|
|
chip={true} |
|
|
chip={true} |
|
|
resetValue={false} |
|
|
resetValue={false} |
|
|
textInputProps={ |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
textInputProps={{ |
|
|
placeholder: "Escola onde você estuda...", |
|
|
placeholder: "Escola onde você estuda...", |
|
|
underlineColorAndroid: "transparent", |
|
|
underlineColorAndroid: "transparent", |
|
|
style: { |
|
|
style: { |
|
|
padding: 12, |
|
|
padding: 12, |
|
|
borderWidth: 1, |
|
|
borderWidth: 1, |
|
|
borderColor: '#ccc', |
|
|
|
|
|
|
|
|
borderColor: "#ccc", |
|
|
borderRadius: 5, |
|
|
borderRadius: 5, |
|
|
alignItems:"flex-start", |
|
|
|
|
|
alignContent:"flex-start", |
|
|
|
|
|
|
|
|
alignItems: "flex-start", |
|
|
|
|
|
backgroundColor: colors.white, |
|
|
|
|
|
alignContent: "flex-start", |
|
|
}, |
|
|
}, |
|
|
onTextChange: text => console.log(text) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
listProps={ |
|
|
|
|
|
{ |
|
|
|
|
|
nestedScrollEnabled: true, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
onTextChange: (text) => console.log(text), |
|
|
|
|
|
}} |
|
|
/> |
|
|
/> |
|
|
</Fragment> |
|
|
</Fragment> |
|
|
|
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
@ -109,31 +110,21 @@ function SchoolPicker(props) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SchoolPicker.defaultProps = { |
|
|
SchoolPicker.defaultProps = { |
|
|
itemSelected: () =>{ }, |
|
|
|
|
|
|
|
|
itemSelected: () => {}, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
const styles = StyleSheet.create({ |
|
|
location: { |
|
|
location: { |
|
|
//flex: 1,
|
|
|
|
|
|
width: "100%", |
|
|
|
|
|
flexDirection: "row", |
|
|
flexDirection: "row", |
|
|
alignItems: "flex-start", |
|
|
|
|
|
justifyContent: "center", |
|
|
|
|
|
zIndex: 10, |
|
|
|
|
|
position: "absolute", |
|
|
|
|
|
backgroundColor: colors.white, |
|
|
|
|
|
}, |
|
|
}, |
|
|
adressText: { |
|
|
adressText: { |
|
|
flex: 0.90, |
|
|
|
|
|
|
|
|
flex: 1 |
|
|
}, |
|
|
}, |
|
|
mapIcon: { |
|
|
mapIcon: { |
|
|
backgroundColor: colors.primary, |
|
|
|
|
|
padding: 8, |
|
|
|
|
|
width: 20, |
|
|
|
|
|
alignItems: "center", |
|
|
|
|
|
borderRadius: 5, |
|
|
|
|
|
flex: 0.10, |
|
|
|
|
|
marginTop: 8, |
|
|
|
|
|
|
|
|
paddingTop: 10, |
|
|
|
|
|
alignSelf: "flex-start", |
|
|
|
|
|
paddingRight: 12, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|