Commit 9be9d952 authored by Yadd's avatar Yadd
Browse files

Add portal/logout links (#1570)

parent d8599b4b
Pipeline #12349 failed with stage
in 81 minutes and 2 seconds
......@@ -45,6 +45,7 @@ store.dispatch({
data: {
staticPrefix: '/static/',
availableLanguages: ['en'],
portal: 'http://auth.example.com',
}
})
store.dispatch({
......
......@@ -40,7 +40,7 @@ const RenderLangs = ({ staticPrefix, langs, setLang, after }) => {
return (<div>{langArr}</div>)
}
else {
return [<div>coucoo</div>];
return (<div>Please wait</div>);
}
};
......
import { connect } from "react-redux";
import useStyles from './css';
const mapStateToProps = (state) => {
if (!state.init.env) return { tr: {} };
return {
tr: state.init.tr,
portal: state.init.env.portal,
}
}
const GoToPortal = connect(mapStateToProps)(({ portal, tr }) => {
const classes = useStyles();
return (<a href={portal} className={classes.menuLink}>{tr.backtoportal}</a>);
});
const Logout = connect(mapStateToProps)(({ portal, tr }) => {
const classes = useStyles();
return (<a href={portal + '?logout=1'} className={classes.menuLink}>{tr.logout}</a>);
});
export { GoToPortal, Logout };
\ No newline at end of file
......@@ -7,11 +7,12 @@
import { connect } from 'react-redux';
import { RenderMenu, RenderMobileMenu } from './_Menu';
import Langs from './Langs';
import { GoToPortal, Logout } from './PortalLinks';
const mapStateToProps = (state) => {
if (!state.init.env) return {};
return {
tr: state.tr,
tr: state.init.tr,
}
};
......@@ -23,6 +24,12 @@ const LRenderRightMenu = ({
handleRightMenuClose,
}) => {
let entries = [
{
content: GoToPortal,
},
{
content: Logout,
},
{
action: () => { console.log('todo') },
content: "TODO",
......@@ -32,7 +39,6 @@ const LRenderRightMenu = ({
content: "TODO2",
},
{
action: () => { },
content: Langs,
},
];
......
......@@ -73,6 +73,11 @@ const useStyles = makeStyles((theme) => ({
outline: 'none',
textDecoration: 'none',
marginRight: theme.spacing(2),
},
menuLink: {
color: 'inherit',
outline: 'none',
textDecoration: 'none',
}
}));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment