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'; ...@@ -15,6 +15,7 @@ import { Config } from 'config/config';
import rootReducer from 'core/reducer'; import rootReducer from 'core/reducer';
import { setConfig } from 'core/actions/appConfig'; import { setConfig } from 'core/actions/appConfig';
import OverviewPage from 'accession/OverviewPage'; import OverviewPage from 'accession/OverviewPage';
import PoweredBy from 'ui/common/PoweredBy';
declare const window: Window & { devToolsExtension: any, __REDUX_DEVTOOLS_EXTENSION_COMPOSE__: any }; declare const window: Window & { devToolsExtension: any, __REDUX_DEVTOOLS_EXTENSION_COMPOSE__: any };
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
...@@ -66,6 +67,7 @@ export function showGenesysUI(holdingNode: HTMLElement, config: Config) { ...@@ -66,6 +67,7 @@ export function showGenesysUI(holdingNode: HTMLElement, config: Config) {
<HelmetProvider> <HelmetProvider>
<App/> <App/>
</HelmetProvider> </HelmetProvider>
<PoweredBy />
</Provider>, </Provider>,
holdingNode, holdingNode,
); );
...@@ -90,7 +92,10 @@ export function showOverview(holdingNode: HTMLElement, config: Config) { ...@@ -90,7 +92,10 @@ export function showOverview(holdingNode: HTMLElement, config: Config) {
ReactDOM.render( ReactDOM.render(
<Provider store={ store }> <Provider store={ store }>
<OverviewPage /> <HelmetProvider>
<OverviewPage />
</HelmetProvider>
<PoweredBy />
</Provider>, </Provider>,
holdingNode, 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> ...@@ -27,7 +27,7 @@ class App extends React.Component<IAppProps & WithTranslation & WithConfig, any>
} }
public render() { public render() {
const { appConfig: { apiUrl, shoppingCart } } = this.props; const { appConfig: { shoppingCart } } = this.props;
return ( return (
<> <>
...@@ -42,11 +42,6 @@ class App extends React.Component<IAppProps & WithTranslation & WithConfig, any> ...@@ -42,11 +42,6 @@ class App extends React.Component<IAppProps & WithTranslation & WithConfig, any>
{ shoppingCart.enabled && <Route path="/request" exact component={ RequestPage }/> } { shoppingCart.enabled && <Route path="/request" exact component={ RequestPage }/> }
<Route component={ NotFound }/> <Route component={ NotFound }/>
</Switch> </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> </div>
</Router> </Router>
</> </>
......
Supports Markdown
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