Skip to content

Commit

Permalink
Merge pull request #546 from bounswe/feat/MB-search-filter-and-colorfix
Browse files Browse the repository at this point in the history
fix: custom header color
  • Loading branch information
furkansenkal authored Dec 16, 2024
2 parents 5002fb6 + 7f1d50c commit a510dfe
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions mobile/src/pages/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import Community from './Community';
import Post from './Post';
import CreatePost from './CreatePost';
import StockDetails from './StockDetails';
import Portfolio from './Portfolio';
import PortfolioDetails from './PortfolioDetails';
import CreatePortfolio from './CreatePortfolio';

import { AuthProvider, useAuth } from './context/AuthContext';

Expand Down Expand Up @@ -89,6 +92,31 @@ const MarketsStack = () => (
</Stack.Navigator>
);

const PortfolioStack = () => (
<Stack.Navigator>
<Stack.Screen
name="Markets1"
component={Portfolio}
options={{ header: ({ navigation }) => <CustomHeader navigation={navigation} /> }}
/>
<Stack.Screen
name="StockDetails"
component={StockDetails}
options={{ headerShown: true, title: 'Stock Details' }}
/>
<Stack.Screen
name="PortfolioDetails"
component={PortfolioDetails}
options={{ headerShown: true, title: 'Portfolio Details' }}
/>
<Stack.Screen
name="CreatePortfolio"
component={CreatePortfolio}
options={{ headerShown: true, title: 'Create Portfolio' }}
/>
</Stack.Navigator>
);

const DrawerNavigator = () => {
const { username, userId } = useAuth();

Expand All @@ -102,7 +130,7 @@ const DrawerNavigator = () => {
}}

>
<Drawer.Screen
<Drawer.Screen
name="Community"
component={PostStack}
options={{ headerShown: false }}
Expand Down Expand Up @@ -135,8 +163,21 @@ const DrawerNavigator = () => {
<Drawer.Screen
name="News"
component={News}

/>
{ userId ? (
<Drawer.Screen
name="Portfolio"
component={PortfolioStack}
options={{ headerShown: false }}

/>
) : (
<Drawer.Screen
name="Portfolio"
component={LoginStack}
options={{ headerShown: false }}
/>
)}

</Drawer.Navigator>
);
Expand All @@ -158,7 +199,7 @@ const App = () => {
const styles = StyleSheet.create({
customHeader: {
height: 60,
backgroundColor: '#0077B6',
backgroundColor: '#007BFF',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
Expand Down

0 comments on commit a510dfe

Please sign in to comment.