Skip to content

Commit

Permalink
Merge pull request #532 from bounswe/feature/MB-portfolio-page
Browse files Browse the repository at this point in the history
Feature/mb portfolio page
  • Loading branch information
m-erkam authored Dec 16, 2024
2 parents 0ba6349 + 684306c commit 164e9a2
Show file tree
Hide file tree
Showing 5 changed files with 1,260 additions and 1 deletion.
43 changes: 42 additions & 1 deletion 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 Down Expand Up @@ -134,8 +162,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 Down
Loading

0 comments on commit 164e9a2

Please sign in to comment.