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
.DS_Store
.vscode/settings.json

3
API.js
View File

@@ -270,6 +270,9 @@ const API = {
getCourses() {
return getCall("/user/courses");
},
getRecentCourses() {
return getCall("/posts/course/recent");
},
searchCourses(query){
return getCall("/user/groups/search", query ? {query, courses: true} : {courses: true}).then((data)=>{
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 { createNativeStackNavigator } from '@react-navigation/native-stack';
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 Login from "./Views/Login.js"
import Feed from "./Views/Feed.js"
@@ -18,7 +18,7 @@ import * as Notifications from 'expo-notifications';
import API from './API.js';
import i18n from "./i18nMessages.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 ProfileSettings from './Views/ProfileSettings.js';
import InviteView from './Views/Invite.js';
@@ -229,7 +229,15 @@ export default function App() {
{props.navigation.canGoBack() ? <Appbar.BackAction onPress={()=>{
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="notifications" onPress={()=>{props.navigation.navigate("Notifications")}} />
</Appbar.Header>

View File

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

View File

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

View File

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