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

Commit

Permalink
fixed noscript break (#535)
Browse files Browse the repository at this point in the history
* fixed noscript break

* fixed the link
  • Loading branch information
naveed-ahmad authored and mmahalwy committed Dec 20, 2016
1 parent 75401e0 commit a0d5bbe
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 26 deletions.
7 changes: 7 additions & 0 deletions src/components/NoScript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom/server';

export default function NoScript(props) {
const staticMarkup = ReactDOM.renderToStaticMarkup(props.children);
return <noscript dangerouslySetInnerHTML={{__html: staticMarkup}} />;
}
23 changes: 0 additions & 23 deletions src/components/NoScriptWarning/index.js

This file was deleted.

18 changes: 16 additions & 2 deletions src/containers/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { asyncConnect } from 'redux-connect';
import Helmet from 'react-helmet';
import Modal from 'react-bootstrap/lib/Modal';
import SmartBanner from 'components/SmartBanner';
import Link from 'react-router/lib/Link';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';

const ModalHeader = Modal.Header;
const ModalTitle = Modal.Title;
Expand All @@ -16,7 +19,7 @@ import config from 'config';
import metricsConfig from 'helpers/metrics';
import { authConnect } from './connect';
import Footer from 'components/Footer';
import NoScriptWarning from 'components/NoScriptWarning';
import NoScript from 'components/NoScript';

import FontStyles from 'components/FontStyles';

Expand All @@ -42,7 +45,18 @@ class App extends Component {
<div>
<Helmet {...config.app.head} />
<FontStyles />
<NoScriptWarning />
<NoScript>
<Row className='noscript-warning'>
<Col md={12}>
<p> Looks like either your browser does not support Javascript or its disabled. Quran.com workes best with JavaScript enabled.
For more instruction on how to enable javascript
<a href="http://www.enable-javascript.com/">
Click here
</a>
</p>
</Col>
</Row>
</NoScript>
{children}
<SmartBanner title="The Noble Quran - القرآن الكريم" button="Install"/>
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";
@import 'partials/tooltip';
@import 'partials/highlight';
@import 'nightmode';

@import 'partials/no-script';

html,body{
height: 100%;
Expand Down
11 changes: 11 additions & 0 deletions src/styles/partials/_no-script.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.noscript-warning {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1201;
text-align: center;
color: #FFF;
background-color: #AE0000;
padding: 5px 0 5px 0;
}

0 comments on commit a0d5bbe

Please sign in to comment.