Commit 5f9c0696 authored by Matija Obreza's avatar Matija Obreza
Browse files

PoweredBy component

parent dc268d33
......@@ -15,6 +15,7 @@ import { Config } from 'config/config';
import rootReducer from 'core/reducer';
import { setConfig } from 'core/actions/appConfig';
import OverviewPage from 'accession/OverviewPage';
import PoweredBy from 'ui/common/PoweredBy';
declare const window: Window & { devToolsExtension: any, __REDUX_DEVTOOLS_EXTENSION_COMPOSE__: any };
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
......@@ -66,6 +67,7 @@ export function showGenesysUI(holdingNode: HTMLElement, config: Config) {
<HelmetProvider>
<App/>
</HelmetProvider>
<PoweredBy />
</Provider>,
holdingNode,
);
......@@ -90,7 +92,10 @@ export function showOverview(holdingNode: HTMLElement, config: Config) {
ReactDOM.render(
<Provider store={ store }>
<OverviewPage />
<HelmetProvider>
<OverviewPage />
</HelmetProvider>
<PoweredBy />
</Provider>,
holdingNode,
);
......
import { WithConfig } from 'config/config';
import * as React from 'react';
import { connect } from 'react-redux';
const PoweredBy = ({ appConfig }: WithConfig) => (
<div style={ { marginTop: 20, textAlign: 'center', fontSize: '10pt', display: 'block', visibility: 'visible' } }>
<img style={ { height: '1.2em', verticalAlign: 'text-bottom', display: 'inline', visibility: 'visible' } } src={ `${appConfig.apiUrl}/html/1/images/GENESYS-ICON.svg` } alt="Genesys PGR" />
<> Powered by <a target="_blank" style={ { display: 'inline', visibility: 'visible' } } title="Data sourced from Genesys" href={ appConfig.apiUrl }>Genesys PGR</a></>
</div>
);
const mapStateToProps = (state) => ({
appConfig: state.appConfig.config,
});
export default connect(mapStateToProps, null)(PoweredBy);
......@@ -27,7 +27,7 @@ class App extends React.Component<IAppProps & WithTranslation & WithConfig, any>
}
public render() {
const { appConfig: { apiUrl, shoppingCart } } = this.props;
const { appConfig: { shoppingCart } } = this.props;
return (
<>
......@@ -42,11 +42,6 @@ class App extends React.Component<IAppProps & WithTranslation & WithConfig, any>
{ shoppingCart.enabled && <Route path="/request" exact component={ RequestPage }/> }
<Route component={ NotFound }/>
</Switch>
<div style={ { marginTop: 20, textAlign: 'center', fontSize: '10pt' } }>
<img style={ { height: '1.2em', verticalAlign: 'text-bottom' } } src={ `${apiUrl}/html/1/images/GENESYS-ICON.svg` } alt="Genesys PGR" />
<> Powered by <a target="_blank" title="Data sourced from Genesys" href={ apiUrl }>Genesys PGR</a></>
</div>
</div>
</Router>
</>
......
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