navigation
parent
60b14f4c9f
commit
66835bfac6
|
@ -12,5 +12,10 @@
|
||||||
"English": "English",
|
"English": "English",
|
||||||
"Romanian": "Romanian"
|
"Romanian": "Romanian"
|
||||||
},
|
},
|
||||||
|
"Menu": {
|
||||||
|
"Home": "Home",
|
||||||
|
"Sessions": "Sessions",
|
||||||
|
"About": "About"
|
||||||
|
},
|
||||||
"Session": "Session"
|
"Session": "Session"
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,5 +3,10 @@
|
||||||
"English": "Engleză",
|
"English": "Engleză",
|
||||||
"Romanian": "Română"
|
"Romanian": "Română"
|
||||||
},
|
},
|
||||||
|
"Menu": {
|
||||||
|
"Home": "Acasă",
|
||||||
|
"Sessions": "Sesiuni",
|
||||||
|
"About": "Despre"
|
||||||
|
},
|
||||||
"Session": "Sesiune"
|
"Session": "Sesiune"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from "react";
|
||||||
import { Route, Switch } from "react-router-dom";
|
import { Route, Switch } from "react-router-dom";
|
||||||
import HomePage from "./home/HomePage";
|
import HomePage from "./home/HomePage";
|
||||||
import AboutPage from "./about/AboutPage";
|
import AboutPage from "./about/AboutPage";
|
||||||
import Header from "./common/Header";
|
import Header from "./layout/Header";
|
||||||
import PageNotFound from "./PageNotFound";
|
import PageNotFound from "./PageNotFound";
|
||||||
import { ToastContainer } from "react-toastify";
|
import { ToastContainer } from "react-toastify";
|
||||||
import "react-toastify/dist/ReactToastify.css";
|
import "react-toastify/dist/ReactToastify.css";
|
||||||
|
@ -12,6 +12,7 @@ function App() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header />
|
<Header />
|
||||||
|
<br />
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/" component={HomePage} />
|
<Route exact path="/" component={HomePage} />
|
||||||
<Route path="/about" component={AboutPage} />
|
<Route path="/about" component={AboutPage} />
|
||||||
|
|
|
@ -7,10 +7,10 @@ import IconButton from "@material-ui/core/IconButton";
|
||||||
import MenuIcon from "@material-ui/icons/Menu";
|
import MenuIcon from "@material-ui/icons/Menu";
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
import MenuItem from "@material-ui/core/MenuItem";
|
||||||
import Menu from "@material-ui/core/Menu";
|
import Menu from "@material-ui/core/Menu";
|
||||||
import { NavLink } from "react-router-dom";
|
|
||||||
import { Container } from "@material-ui/core";
|
import { Container } from "@material-ui/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import Flag from "react-flags";
|
import Flag from "react-flags";
|
||||||
|
import Navigation from "./Navigation";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
|
@ -26,8 +26,6 @@ const useStyles = makeStyles((theme) => ({
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const activeStyle = { color: "#F15B2A" };
|
|
||||||
|
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
|
|
||||||
const [anchorEl, setAnchorEl] = useState(null);
|
const [anchorEl, setAnchorEl] = useState(null);
|
||||||
|
@ -78,22 +76,7 @@ const Header = () => {
|
||||||
<Typography variant="h6" className={classes.title}>
|
<Typography variant="h6" className={classes.title}>
|
||||||
Reverse proxy
|
Reverse proxy
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<Navigation />
|
||||||
<NavLink to="/" activeStyle={activeStyle} exact>
|
|
||||||
Home
|
|
||||||
</NavLink>
|
|
||||||
{" | "}
|
|
||||||
<NavLink to="/courses" activeStyle={activeStyle}>
|
|
||||||
Courses
|
|
||||||
</NavLink>
|
|
||||||
{" | "}
|
|
||||||
<NavLink to="/sessions" activeStyle={activeStyle}>
|
|
||||||
Sessions
|
|
||||||
</NavLink>
|
|
||||||
{" | "}
|
|
||||||
<NavLink to="/about" activeStyle={activeStyle}>
|
|
||||||
About
|
|
||||||
</NavLink>
|
|
||||||
</Container>
|
</Container>
|
||||||
|
|
||||||
<div>
|
<div>
|
|
@ -0,0 +1,28 @@
|
||||||
|
import React from "react";
|
||||||
|
import { NavLink } from "react-router-dom";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
const Navigation = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const activeStyle = { color: "#F15B2A" };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<NavLink to="/" activeStyle={activeStyle} exact>
|
||||||
|
{t("Menu.Home")}
|
||||||
|
</NavLink>
|
||||||
|
{" | "}
|
||||||
|
<NavLink to="/sessions" activeStyle={activeStyle}>
|
||||||
|
{t("Menu.Sessions")}
|
||||||
|
</NavLink>
|
||||||
|
{" | "}
|
||||||
|
<NavLink to="/about" activeStyle={activeStyle}>
|
||||||
|
{t("Menu.About")}
|
||||||
|
</NavLink>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Navigation.propTypes = {};
|
||||||
|
|
||||||
|
export default Navigation;
|
|
@ -16,7 +16,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
|
|
||||||
const SessionSummary = ({ session }) => {
|
const SessionSummary = ({ session }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { t, i18n } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Reference in New Issue