Skip to content

Commit

Permalink
Merge pull request #328 from bounswe/feature/MB-create-home-page-cli
Browse files Browse the repository at this point in the history
Home page is created
  • Loading branch information
furkansenkal authored Oct 21, 2024
2 parents e607702 + ed52eb2 commit 3f32663
Show file tree
Hide file tree
Showing 15 changed files with 673 additions and 36 deletions.
2 changes: 2 additions & 0 deletions mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"


/**
* This is the configuration block to customize your React Native Android app.
Expand Down
Binary file added mobile/assets/stock-logos/akbank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/bist-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/bist-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/bist-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/bist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/eregl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/gubrf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/thy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/stock-logos/ykbnk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
189 changes: 188 additions & 1 deletion mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"react-native-gesture-handler": "^2.12.0",
"react-native-reanimated": "^3.0.0-rc.3",
"react-native-safe-area-context": "^4.7.1",
"react-native-screens": "^3.23.0"
"react-native-screens": "^3.23.0",
"react-native-svg": "^15.8.0",
"react-native-vector-icons": "^10.2.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
103 changes: 88 additions & 15 deletions mobile/src/pages/App.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,103 @@
import 'react-native-gesture-handler';
import React from 'react';
import { View, TouchableOpacity, Text, StyleSheet, Image } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import Login from './Login';
import Register from './Register';
import ForgotPassword from './ForgotPassword';
import Home from './Home'

const Stack = createStackNavigator();
const Sidebar = createDrawerNavigator();


const App = () => {
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName="Login"
screenOptions={{
headerShown: false, // Hide the header for all screens
}}
>
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Register" component={Register} />
<Stack.Screen name="ForgotPassword" component={ForgotPassword} />
<Stack.Screen name="Home" component={Home} />
</Stack.Navigator>
</NavigationContainer>
);

const CustomHeader = ({ navigation, title }) => (
<View style={styles.header}>
<TouchableOpacity onPress={() => navigation.toggleDrawer()}>
<MaterialIcons name="menu" size={30} color="white" />
</TouchableOpacity>
<View style={styles.logo}>
{/* <Image
source={require('../../assets/IconKitchen-Output/ios/AppIcon~ipad.png')}
/> */}
<Text style={styles.logoText}> Bull&Bear </Text>
</View>
<TouchableOpacity onPress={() => navigation.toggleDrawer()}>
<MaterialIcons name="account-circle" size={30} color="white" />
</TouchableOpacity>
</View>
);

const LoginRelated = () => {
return (
<Stack.Navigator>
<Stack.Screen name="Login" component={Login} options={{headerShown:false}}></Stack.Screen>
<Stack.Screen name="Register" component={Register} options={{headerShown:false}}></Stack.Screen>
<Stack.Screen name="ForgotPassword" component={ForgotPassword} options={{headerShown:false}}></Stack.Screen>
</Stack.Navigator>
)
}

return (
<NavigationContainer>
<Sidebar.Navigator>
<Sidebar.Screen
name="Home"
component={Home}
options={({ navigation }) => ({
header: () => <CustomHeader navigation={navigation} title="Home" />,
})}
/>
<Sidebar.Screen
name="Login"
component={LoginRelated}
options={({ navigation }) => ({
header: () => <CustomHeader navigation={navigation} title="Login" />,
})}
/>
</Sidebar.Navigator>
</NavigationContainer>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
header: {
height: 50,
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 15,
borderBottomWidth: 1,
borderBottomColor: '#ddd',
backgroundColor:"#0077B6",
},
headerTitle: {
marginLeft: 10,
fontSize: 18,
fontWeight: 'bold',
},
logo:{
flexDirection:"row",
marginLeft:100,
marginRight:100,
},
logoText:{
fontSize:18,
fontWeight:"bold",
color:"white"
},
});

export default App;

Loading

0 comments on commit 3f32663

Please sign in to comment.