Navigation update
parent
550a602a80
commit
933ba890e5
|
@ -16,6 +16,7 @@
|
||||||
"Home": "Home",
|
"Home": "Home",
|
||||||
"Sessions": "Sessions",
|
"Sessions": "Sessions",
|
||||||
"ReleaseNotes": "Release notes",
|
"ReleaseNotes": "Release notes",
|
||||||
|
"Log": "Log",
|
||||||
"About": "About"
|
"About": "About"
|
||||||
},
|
},
|
||||||
"General": {
|
"General": {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"Home": "Acasă",
|
"Home": "Acasă",
|
||||||
"Sessions": "Sesiuni",
|
"Sessions": "Sesiuni",
|
||||||
"ReleaseNotes": "Note lansare",
|
"ReleaseNotes": "Note lansare",
|
||||||
|
"Log": "Jurnal",
|
||||||
"About": "Despre"
|
"About": "Despre"
|
||||||
},
|
},
|
||||||
"General": {
|
"General": {
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
import React from "react";
|
||||||
|
import { NavLink } from "react-router-dom";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
|
const MenuLink = ({ to, label, exact, last }) => {
|
||||||
|
const activeStyle = { color: "#F15B2A" };
|
||||||
|
const style = { color: "#fff" };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<NavLink to={to} activeStyle={activeStyle} style={style} exact={exact}>
|
||||||
|
{label}
|
||||||
|
</NavLink>
|
||||||
|
{!last && " | "}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
MenuLink.propTypes = {
|
||||||
|
to: PropTypes.string.isRequired,
|
||||||
|
label: PropTypes.string.isRequired,
|
||||||
|
exact: PropTypes.bool,
|
||||||
|
last: PropTypes.bool
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MenuLink;
|
|
@ -1,29 +1,17 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { NavLink } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import MenuLink from "./MenuLink";
|
||||||
|
|
||||||
const Navigation = () => {
|
const Navigation = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const activeStyle = { color: "#F15B2A" };
|
|
||||||
const style = { color: "#fff" };
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NavLink to="/" activeStyle={activeStyle} style={style} exact>
|
<MenuLink to="/" label={t("Menu.Home")} exact />
|
||||||
{t("Menu.Home")}
|
<MenuLink to="/sessions" label={t("Menu.Sessions")} />
|
||||||
</NavLink>
|
<MenuLink to="/release-notes" label={t("Menu.ReleaseNotes")} />
|
||||||
{" | "}
|
<MenuLink to="/log" label={t("Menu.Log")} />
|
||||||
<NavLink to="/sessions" activeStyle={activeStyle} style={style}>
|
<MenuLink to="/about" label={t("Menu.About")} last />
|
||||||
{t("Menu.Sessions")}
|
|
||||||
</NavLink>
|
|
||||||
{" | "}
|
|
||||||
<NavLink to="/release-notes" activeStyle={activeStyle} style={style}>
|
|
||||||
{t("Menu.ReleaseNotes")}
|
|
||||||
</NavLink>
|
|
||||||
{" | "}
|
|
||||||
<NavLink to="/about" activeStyle={activeStyle} style={style}>
|
|
||||||
{t("Menu.About")}
|
|
||||||
</NavLink>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue