Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit 548d4e7

Browse files
committed
Merge branch 'master' into production
2 parents c632b81 + 75e4a1c commit 548d4e7

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
import Link from 'react-router/lib/Link';
3+
4+
const PdfFooter = () => (
5+
<footer>
6+
<div className="container">
7+
<div className="row">
8+
<div className="col-md-12">
9+
<p className="text-center">
10+
This PDF is exported from {' '}
11+
<Link to="https://quran.com">Quran.com</Link>
12+
</p>
13+
</div>
14+
</div>
15+
</div>
16+
</footer>
17+
);
18+
19+
export default PdfFooter;

src/containers/App/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class App extends Component {
5353
const {
5454
main,
5555
nav,
56+
footer,
5657
children,
5758
media,
5859
footNote,
@@ -98,7 +99,7 @@ class App extends Component {
9899
/>}
99100
{children || main}
100101
<SmartBanner title="The Noble Quran - القرآن الكريم" button="Install" />
101-
<Footer />
102+
{footer || <Footer />}
102103
{__CLIENT__ &&
103104
<Modal
104105
bsSize="large"
@@ -152,6 +153,7 @@ App.propTypes = {
152153
children: PropTypes.element,
153154
main: PropTypes.element,
154155
nav: PropTypes.element,
156+
footer: PropTypes.element,
155157
sidebar: PropTypes.element,
156158
footNote: customPropTypes.footNoteType,
157159
loadingFootNote: PropTypes.bool

src/routes.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,19 @@ export default (store) => {
173173
<Route
174174
path="/:chapterId(/:range).pdf"
175175
getComponents={(nextState, cb) =>
176-
import('./containers/Pdf')
177-
.then(module => cb(null, { main: module.default, nav: 'noscript' }))
178-
.catch(err => console.trace(err))}
179-
onEnter={checkValidChapterOrVerse}
180-
/>
181-
182-
<Route
183-
path="/:chapterId(/:range).pdf"
184-
getComponents={(nextState, cb) =>
185-
import(/* webpackChunkName: "pdf" */ './containers/Pdf')
186-
.then(module => cb(null, { main: module.default, nav: 'noscript' }))
176+
Promise.all([
177+
import(/* webpackChunkName: "pdf" */ './containers/Pdf'),
178+
import(
179+
/* webpackChunkName: "pdf-footer" */ './components/Footer/PdfFooter'
180+
)
181+
])
182+
.then(modules =>
183+
cb(null, {
184+
main: modules[0].default,
185+
footer: modules[1].default,
186+
nav: 'noscript'
187+
})
188+
)
187189
.catch(err => console.trace(err))}
188190
onEnter={checkValidChapterOrVerse}
189191
/>

0 commit comments

Comments
 (0)