mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
moved navigation to use react router dom
This commit is contained in:
1 parent
1d4faa4bf9
commit
23e4da2007
2 files changed
+24
-4
No files matched your search
@@ -1,4 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
import { BottomNavigation, BottomNavigationAction } from "@material-ui/core";
|
import { BottomNavigation, BottomNavigationAction } from "@material-ui/core";
|
||||||
import HomeIcon from "@material-ui/icons/Home";
|
import HomeIcon from "@material-ui/icons/Home";
|
||||||
@@ -20,9 +21,21 @@ export function TwitterBottomNavigation({ activePage, handleChange }) {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
className={classes.root}
|
className={classes.root}
|
||||||
>
|
>
|
||||||
<BottomNavigationAction icon={<HomeIcon />} />
|
<BottomNavigationAction
|
||||||
<BottomNavigationAction icon={<SearchIcon />} />
|
component={Link}
|
||||||
<BottomNavigationAction icon={<ProfileIcon />} />
|
to="/twitter"
|
||||||
|
icon={<HomeIcon />}
|
||||||
|
/>
|
||||||
|
<BottomNavigationAction
|
||||||
|
component={Link}
|
||||||
|
to="/twitter/search"
|
||||||
|
icon={<SearchIcon />}
|
||||||
|
/>
|
||||||
|
<BottomNavigationAction
|
||||||
|
component={Link}
|
||||||
|
to="/twitter/profile"
|
||||||
|
icon={<ProfileIcon />}
|
||||||
|
/>
|
||||||
</BottomNavigation>
|
</BottomNavigation>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { Switch, Route } from "react-router-dom";
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
|
|
||||||
import Nui from "../../../os/nui-events/utils/Nui";
|
import Nui from "../../../os/nui-events/utils/Nui";
|
||||||
@@ -70,7 +71,13 @@ export const TwitterApp = () => {
|
|||||||
<AddTweetModal />
|
<AddTweetModal />
|
||||||
<div className={modalVisible ? classes.backgroundModal : null} />
|
<div className={modalVisible ? classes.backgroundModal : null} />
|
||||||
<TwitterTitle />
|
<TwitterTitle />
|
||||||
<AppContent>{PAGE_COMPONENT_MAPPING[activePage]}</AppContent>
|
<AppContent>
|
||||||
|
<Switch>
|
||||||
|
<Route path="/twitter" exact component={TweetListContainer} />
|
||||||
|
<Route path="/twitter/search" component={TwitterSearch} />
|
||||||
|
<Route path="/twitter/profile" component={TwitterProfile} />
|
||||||
|
</Switch>
|
||||||
|
</AppContent>
|
||||||
{showTweetButton && <TweetButton openModal={openModal} />}
|
{showTweetButton && <TweetButton openModal={openModal} />}
|
||||||
<AlertBar />
|
<AlertBar />
|
||||||
<BottomNavigation
|
<BottomNavigation
|
||||||
|
|||||||
Reference in new issue
Block a user