int work and icon on header

This commit is contained in:
Adolfo Reyna
2023-01-08 20:42:09 -05:00
parent c725eda32f
commit caf2a8ee04
6 changed files with 55 additions and 27 deletions

1
.gitignore vendored
View File

@@ -12,3 +12,4 @@ web-build/
# macOS # macOS
.DS_Store .DS_Store
.vscode/settings.json

3
API.js
View File

@@ -270,6 +270,9 @@ const API = {
getCourses() { getCourses() {
return getCall("/user/courses"); return getCall("/user/courses");
}, },
getRecentCourses() {
return getCall("/posts/course/recent");
},
searchCourses(query){ searchCourses(query){
return getCall("/user/groups/search", query ? {query, courses: true} : {courses: true}).then((data)=>{ return getCall("/user/groups/search", query ? {query, courses: true} : {courses: true}).then((data)=>{
if(data.status == "ok"){ if(data.status == "ok"){

14
App.js
View File

@@ -3,7 +3,7 @@ import React, { useState, useRef, useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Provider as PaperProvider, DefaultTheme, Appbar, Button, } from 'react-native-paper'; import { Provider as PaperProvider, DefaultTheme, Appbar, Button } from 'react-native-paper';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import Login from "./Views/Login.js" import Login from "./Views/Login.js"
import Feed from "./Views/Feed.js" import Feed from "./Views/Feed.js"
@@ -18,7 +18,7 @@ import * as Notifications from 'expo-notifications';
import API from './API.js'; import API from './API.js';
import i18n from "./i18nMessages.js"; import i18n from "./i18nMessages.js";
import NewPostView from './Views/NewPost.js'; import NewPostView from './Views/NewPost.js';
import { TouchableOpacity, View } from 'react-native'; import { TouchableOpacity, View, Image } from 'react-native';
import MenuView from './Views/Menu.js'; import MenuView from './Views/Menu.js';
import ProfileSettings from './Views/ProfileSettings.js'; import ProfileSettings from './Views/ProfileSettings.js';
import InviteView from './Views/Invite.js'; import InviteView from './Views/Invite.js';
@@ -229,7 +229,15 @@ export default function App() {
{props.navigation.canGoBack() ? <Appbar.BackAction onPress={()=>{ {props.navigation.canGoBack() ? <Appbar.BackAction onPress={()=>{
props.navigation.goBack(); props.navigation.goBack();
}} /> : <></>} }} /> : <></>}
<Appbar.Content title='EMI Fellowship'/> <Appbar.Content title={
<Button icon={({ size, color }) => (
<Image
source={require('./assets/icon.png')}
style={{ width: size, height: size }}
/>
)} mode="text" >EMI Fellowship</Button>
} titleStyle={{}}/>
<Appbar.Action icon="chat" onPress={()=>{alert("Chats are comming soon.")}} />
<Appbar.Action icon="search" onPress={()=>{props.navigation.navigate("Search")}} /> <Appbar.Action icon="search" onPress={()=>{props.navigation.navigate("Search")}} />
<Appbar.Action icon="notifications" onPress={()=>{props.navigation.navigate("Notifications")}} /> <Appbar.Action icon="notifications" onPress={()=>{props.navigation.navigate("Notifications")}} />
</Appbar.Header> </Appbar.Header>

View File

@@ -23,16 +23,16 @@ let MenuView = ({navigation})=>{
imageStyle={{resizeMode:"contain", opacity: 0.05}} imageStyle={{resizeMode:"contain", opacity: 0.05}}
> >
<List.Section title="User Actions"> <List.Section title="User Actions">
<List.Item title="Profile" onPress={()=>{navigation.navigate("ProfileSettings")}} left={props => <List.Icon {...props} icon="person" />} /> <List.Item title={i18n.t('message.profile')} onPress={()=>{navigation.navigate("ProfileSettings")}} left={props => <List.Icon {...props} icon="person" />} />
<List.Item title="Settings" left={props => <List.Icon {...props} icon="settings" />} /> <List.Item title={i18n.t('message.settings')} left={props => <List.Icon {...props} icon="settings" />} />
<List.Item title="Sign out" onPress={()=>{navigation.navigate("Logout")}} left={props => <List.Icon {...props} icon="logout" />} /> <List.Item title={i18n.t('message.logout')} onPress={()=>{navigation.navigate("Logout")}} left={props => <List.Icon {...props} icon="logout" />} />
</List.Section> </List.Section>
<List.Section title="Fellowship App"> <List.Section title="Fellowship App">
<List.Item title="Invite" onPress={()=>{navigation.navigate("Invite")}} left={props => <List.Icon {...props} icon="person-add" />} /> <List.Item title={i18n.t('message.invite')} onPress={()=>{navigation.navigate("Invite")}} left={props => <List.Icon {...props} icon="person-add" />} />
<List.Item title="About" left={props => <List.Icon {...props} icon="more" />} /> <List.Item title={i18n.t('message.about')} left={props => <List.Icon {...props} icon="more" />} />
</List.Section> </List.Section>
<View style={{padding: 10}}> <View style={{padding: 10}}>
<Text>Lenguage:</Text> <Text>Language:</Text>
<RadioButton.Group onValueChange={newValue => changeLang(newValue)} value={value}> <RadioButton.Group onValueChange={newValue => changeLang(newValue)} value={value}>
<RadioButton.Item value="es" label="Español"/> <RadioButton.Item value="es" label="Español"/>
<RadioButton.Item value="en" label="English"/> <RadioButton.Item value="en" label="English"/>

View File

@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { View, ImageBackground, ScrollView } from "react-native"; import { View, ImageBackground, ScrollView, Picker } from "react-native";
import { Text, TextInput, Button, Divider, Checkbox } from "react-native-paper"; import { Text, TextInput, Button, Divider, Checkbox, RadioButton } from "react-native-paper";
import i18n from "../i18nMessages.js"; import i18n from "../i18nMessages.js";
import Moment from 'moment'; import Moment from 'moment';
import 'moment/min/locales'; import 'moment/min/locales';
@@ -118,7 +118,14 @@ let ProfileSettings = ()=>{
value={description} value={description}
onChangeText={text => setDescription(text)} onChangeText={text => setDescription(text)}
/> />
<Button icon="photo" mode="outlined" onPress={pickImage} >Update Photo</Button> <Text>Language:</Text>
<View style={{flexDirection:"row"}}>
<RadioButton.Group value='en' style={{flexDirection:"row"}}>
<RadioButton.Item value="es" label="Español"/>
<RadioButton.Item value="en" label="English"/>
</RadioButton.Group>
</View>
<Button icon="photo" mode="outlined" onPress={pickImage} >{i18n.t("message.updatePhoto")}</Button>
<Divider /> <Divider />
<View style={{paddingTop: 10}}> <View style={{paddingTop: 10}}>
<Text style={{fontSize:20, padding: 5, color:"#666"}}>Preview:</Text> <Text style={{fontSize:20, padding: 5, color:"#666"}}>Preview:</Text>
@@ -126,45 +133,40 @@ let ProfileSettings = ()=>{
</View> </View>
<Button mode="outlined" onPress={updateProfile}>{i18n.t("message.update")}</Button> <Button mode="outlined" onPress={updateProfile}>{i18n.t("message.update")}</Button>
<Divider /> <Divider />
<Text style={{fontSize:20, padding: 5, color:"#666"}}>Optional:</Text> <Text style={{fontSize:20, padding: 5, color:"#666"}}>{i18n.t("message.optional")}:</Text>
<View style={{flexDirection:"row", justifyContent:"space-between"}}> <View style={{flexDirection:"row", justifyContent:"space-evenly"}}>
<Checkbox.Item status={'unchecked'} label="Married" /> <Checkbox.Item status={'unchecked'} label="Married" />
<Checkbox.Item status={'unchecked'} label="With Kids" /> <Checkbox.Item status={'unchecked'} label="With Kids" />
</View> </View>
<Text>{i18n.t("message.birthday")}</Text>
<View style={{flexDirection:"row", justifyContent:"space-between"}}> <View style={{flexDirection:"row", justifyContent:"space-between"}}>
<TextInput <TextInput
label={"Birthday Day:"} label={"Day:"}
style={{width:"48%", backgroundColor:"rgba(0,0,0,0)"}} style={{width:"48%", backgroundColor:"rgba(0,0,0,0)"}}
//value={name} //value={name}
//onChangeText={text => setName(text)} //onChangeText={text => setName(text)}
/> />
<TextInput <TextInput
label={"Birtday Month:"} label={"Month:"}
style={{width:"48%", backgroundColor:"rgba(0,0,0,0)"}} style={{width:"48%", backgroundColor:"rgba(0,0,0,0)"}}
//value={lastName} //value={lastName}
//onChangeText={text => setLastName(text)} //onChangeText={text => setLastName(text)}
/> />
</View> </View>
<TextInput <TextInput
label={"Local Ministry"} label={i18n.t("message.localMinistry")}
style={{backgroundColor:"rgba(0,0,0,0)"}} style={{backgroundColor:"rgba(0,0,0,0)"}}
//value={lastName} //value={lastName}
//onChangeText={text => setLastName(text)} //onChangeText={text => setLastName(text)}
/> />
<TextInput <TextInput
label={"Country"} label={i18n.t("message.country")}
style={{backgroundColor:"rgba(0,0,0,0)"}} style={{backgroundColor:"rgba(0,0,0,0)"}}
//value={lastName} //value={lastName}
//onChangeText={text => setLastName(text)} //onChangeText={text => setLastName(text)}
/> />
<TextInput <TextInput
label={"ZipCode"} label={i18n.t("message.ocupation")}
style={{backgroundColor:"rgba(0,0,0,0)"}}
//value={lastName}
//onChangeText={text => setLastName(text)}
/>
<TextInput
label={"Ocupation"}
style={{backgroundColor:"rgba(0,0,0,0)"}} style={{backgroundColor:"rgba(0,0,0,0)"}}
//value={lastName} //value={lastName}
//onChangeText={text => setLastName(text)} //onChangeText={text => setLastName(text)}

View File

@@ -17,6 +17,7 @@ const messages = {
profile: "Profile", profile: "Profile",
settings: 'Settings', settings: 'Settings',
logout: "Logout", logout: "Logout",
about: 'about',
statusUpdate: "New Post", statusUpdate: "New Post",
newsPost: "News Post", newsPost: "News Post",
post: "Post", post: "Post",
@@ -65,6 +66,12 @@ const messages = {
update: "Update", update: "Update",
invalidEmail: "Email address is invalid!", invalidEmail: "Email address is invalid!",
reviewPassword: "Please review your passwrod.", reviewPassword: "Please review your passwrod.",
updatePhoto: "Update Photo",
optional: "Optional",
birthday: "Birthday",
localMinistry: "Local Ministry",
ocupation: "Ocupation",
country: 'Country',
}, },
}, },
es: { es: {
@@ -80,6 +87,7 @@ const messages = {
profile: "Perfil", profile: "Perfil",
settings: 'Configuraciones', settings: 'Configuraciones',
logout: "Cerrar Sesión", logout: "Cerrar Sesión",
about: 'Acerca',
statusUpdate: "Publicación Nueva", statusUpdate: "Publicación Nueva",
newsPost: "Noticias?", newsPost: "Noticias?",
post: "Publica", post: "Publica",
@@ -128,6 +136,12 @@ const messages = {
update: "Actualizar", update: "Actualizar",
invalidEmail: "El correo electronico es invalido!", invalidEmail: "El correo electronico es invalido!",
reviewPassword: "Revisa la constraseña introducida.", reviewPassword: "Revisa la constraseña introducida.",
updatePhoto: "Nueva foto",
optional: "Opcional",
birthday: "Cumpleaños",
localMinistry: "Ministerio Local",
ocupation: "Ocupación",
country: 'Pais',
}, },
} }
} }