-
(
+ ,
+ }
+ >
+
+
+
+
+
+ ]}
+ rightControls={[
+ ,
+ ,
+ ,
+
+ ]}
+ />
+);
+
+GlobalNavSurah.propTypes = {
+ surah: surahType.isRequired,
+ surahs: PropTypes.objectOf(surahType).isRequired,
+ options: optionsType.isRequired,
+ setOption: PropTypes.func.isRequired,
+};
+
+function mapStateToProps(state, ownProps) {
+ const surahId = parseInt(ownProps.params.surahId, 10);
+ const surah: Object = state.surahs.entities[surahId];
+
+ return {
+ surah,
+ surahs: state.surahs.entities,
+ options: state.options
+ };
+}
+
+export default connect(mapStateToProps, OptionsActions)(GlobalNavSurah);
diff --git a/src/components/GlobalNav/index.js b/src/components/GlobalNav/index.js
new file mode 100644
index 000000000..60aeaa33e
--- /dev/null
+++ b/src/components/GlobalNav/index.js
@@ -0,0 +1,130 @@
+/* global window */
+import React, { PropTypes, Component } from 'react';
+import { connect } from 'react-redux';
+import Link from 'react-router/lib/Link';
+import Navbar from 'react-bootstrap/lib/Navbar';
+import Nav from 'react-bootstrap/lib/Nav';
+
+import LocaleSwitcher from 'components/LocaleSwitcher';
+
+import debug from 'helpers/debug';
+import { userType } from 'types';
+
+const styles = require('./style.scss');
+
+class GlobalNav extends Component {
+ static propTypes = {
+ // handleToggleSidebar: PropTypes.func.isRequired,
+ leftControls: PropTypes.arrayOf(PropTypes.element),
+ rightControls: PropTypes.arrayOf(PropTypes.element),
+ handleSidebarToggle: PropTypes.func.isRequired,
+ isStatic: PropTypes.bool.isRequired,
+ user: userType,
+ location: PropTypes.shape({
+ action: PropTypes.string,
+ hash: PropTypes.string,
+ pathname: PropTypes.string,
+ search: PropTypes.string,
+ query: PropTypes.objectOf(PropTypes.string)
+ })
+ };
+
+ static defaultProps = {
+ isStatic: false
+ };
+
+ state = {
+ scrolled: false
+ }
+
+ componentDidMount() {
+ window.addEventListener('scroll', this.handleNavbar, true);
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener('scroll', this.handleNavbar, true);
+ }
+
+ handleNavbar = () => {
+ const { isStatic } = this.props;
+ const { scrolled } = this.state;
+
+ if (window.pageYOffset > 50) {
+ if (!scrolled && !isStatic) {
+ this.setState({ scrolled: true });
+ }
+ } else if (scrolled) {
+ this.setState({ scrolled: false });
+ }
+
+ return false;
+ }
+
+ isHome() {
+ return this.props.location.pathname === '/';
+ }
+
+ renderRightControls() {
+ const { user, rightControls } = this.props;
+
+ return rightControls || [
+ ,
+ user ?
+
+
+ {user.firstName || user.name}
+
+ :
+
+ ];
+ }
+
+ render() {
+ const { leftControls, handleSidebarToggle, isStatic } = this.props;
+ debug('component:GlobalNav', 'Render');
+
+ return (
+
+
+
+
+
+ );
+ }
+}
+
+export default connect(
+ state => ({
+ user: state.auth.user
+ })
+)(GlobalNav);
diff --git a/src/components/GlobalNav/style.scss b/src/components/GlobalNav/style.scss
new file mode 100644
index 000000000..1fff5993b
--- /dev/null
+++ b/src/components/GlobalNav/style.scss
@@ -0,0 +1,20 @@
+@import '../../styles/variables.scss';
+
+.scrolled{
+ box-shadow: 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2);
+}
+
+.nav{
+ @media(max-width: $screen-sm){
+ // display: inline-block;
+ :global(& > li){
+ display: inline-block;
+ }
+ }
+}
+
+.optionsDropdown{
+ :global(.ss-icon){
+ margin-right: 5px;
+ }
+}
diff --git a/src/components/GlobalSidebar/Surah/index.js b/src/components/GlobalSidebar/Surah/index.js
new file mode 100644
index 000000000..82c843399
--- /dev/null
+++ b/src/components/GlobalSidebar/Surah/index.js
@@ -0,0 +1,29 @@
+import React, { PropTypes } from 'react';
+import { connect } from 'react-redux';
+
+import { surahType } from 'types';
+import GlobalSidebar from '../index.js';
+
+const GlobalSidebarSurah = ({ ...props, surah, ayahIds }) => (
+
+);
+
+GlobalSidebarSurah.propTypes = {
+ surah: surahType,
+ ayahIds: PropTypes.instanceOf(Set)
+};
+
+function mapStateToProps(state, ownProps) {
+ const surahId = parseInt(ownProps.params.surahId, 10);
+ const surah: Object = state.surahs.entities[surahId];
+ const ayahs: Object = state.ayahs.entities[surahId];
+ const ayahArray = ayahs ? Object.keys(ayahs).map(key => parseInt(key.split(':')[1], 10)) : [];
+ const ayahIds = new Set(ayahArray);
+
+ return {
+ surah,
+ ayahIds
+ };
+}
+
+export default connect(mapStateToProps)(GlobalSidebarSurah);
diff --git a/src/components/GlobalSidebar/index.js b/src/components/GlobalSidebar/index.js
new file mode 100644
index 000000000..ef3f474fe
--- /dev/null
+++ b/src/components/GlobalSidebar/index.js
@@ -0,0 +1,132 @@
+/* global document */
+import React, { PropTypes, Component } from 'react';
+import Link from 'react-router/lib/Link';
+import Navbar from 'react-bootstrap/lib/Navbar';
+import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
+import SettingsModal from 'components/SettingsModal';
+
+const styles = require('./style.scss');
+
+const NavbarHeader = Navbar.Header;
+
+class GlobalSidebar extends Component {
+ static propTypes = {
+ open: PropTypes.bool.isRequired,
+ handleOpen: PropTypes.func,
+ settingsModalProps: PropTypes.object, // eslint-disable-line
+ children: PropTypes.node
+ };
+
+ static defaultProps = {
+ open: false
+ };
+
+ state = {
+ settingsModalOpen: false
+ }
+
+ componentDidMount() {
+ document.body.addEventListener('click', this.onBodyClick.bind(this), true);
+ }
+
+ componentWillUnmount() {
+ document.body.removeEventListener('click', this.onBodyClick.bind(this), true);
+ }
+
+ onBodyClick = () => {
+ const { open, handleOpen } = this.props;
+
+ if (open) {
+ return handleOpen(false);
+ }
+
+ return false;
+ }
+
+ render() {
+ const { open, handleOpen, settingsModalProps, children } = this.props;
+
+ return (
+
+
+
+ handleOpen(false)}
+ >
+
+
+
+
+
+
this.setState({ settingsModalOpen: false })}
+ />
+
+ );
+ }
+}
+
+export default GlobalSidebar;
diff --git a/src/components/GlobalSidebar/style.scss b/src/components/GlobalSidebar/style.scss
new file mode 100644
index 000000000..db043d0e2
--- /dev/null
+++ b/src/components/GlobalSidebar/style.scss
@@ -0,0 +1,64 @@
+@import '../../styles/variables.scss';
+
+$width: 280px;
+
+.container{
+ position: fixed;
+ left: $width * -1;
+ top: 0px;
+ bottom: 0px;
+ background: #fff;
+ z-index: 1031;
+ box-shadow: 0 16px 24px 2px rgba(0,0,0,0.14), 0 6px 30px 5px rgba(0,0,0,0.12), 0 8px 10px -5px rgba(0,0,0,0.2);
+ visibility: hidden;
+
+ background: #fff;
+ width: $width;
+ transition: left 0.35s cubic-bezier(0.24,1,0.32,1), visibility 0.2s;
+
+ &.open{
+ left: 0px;
+ visibility: visible;;
+ }
+
+ :global(.navbar-text){
+ margin-left: 0px;
+ }
+
+ @media(max-width: $screen-sm) {
+ width: $width;
+ left: -1 * $width;
+
+ &.open{
+ left: 0px;
+ }
+
+ :global(.navbar-text){
+ padding-left: 15px;
+ }
+ }
+}
+
+.list{
+ padding-left: 0px;
+
+ :global(li){
+ color: #777;
+
+ :global(a){
+ color: #777;
+ padding: 10px 15px;
+ display: block;
+
+ :global(.ss-icon){
+ font-size: 18px;
+ margin-right: 20px;
+ }
+
+ &:hover{
+ background: #f5f5f5;
+ color: #333;
+ }
+ }
+ }
+}
diff --git a/src/components/Home/LastVisit/index.js b/src/components/Home/LastVisit/index.js
index 55c9ae68e..3ebb76210 100644
--- a/src/components/Home/LastVisit/index.js
+++ b/src/components/Home/LastVisit/index.js
@@ -1,16 +1,19 @@
import React, { PropTypes } from 'react';
import debug from 'helpers/debug';
import Link from 'react-router/lib/Link';
+import { surahType } from 'types';
import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
const styles = require('containers/Home/style.scss');
const LastVisit = (props) => {
debug('component:Index', 'LastVisit');
+ if (!props.surah) return false;
+
return (
-
+ {' '}
{props.surah.name.simple} ({props.surah.id}:{props.ayah})
@@ -22,7 +25,7 @@ const LastVisit = (props) => {
};
LastVisit.propTypes = {
- surah: PropTypes.object.isRequired,
+ surah: surahType.isRequired,
ayah: PropTypes.number.isRequired
};
diff --git a/src/components/Home/QuickSurahs/index.js b/src/components/Home/QuickSurahs/index.js
index 17521f1ab..f1f7d7bba 100644
--- a/src/components/Home/QuickSurahs/index.js
+++ b/src/components/Home/QuickSurahs/index.js
@@ -14,7 +14,7 @@ export default () => {
return (
-
+
{
isFriday &&
@@ -65,5 +65,6 @@ export default () => {
- );
+
+ );
};
diff --git a/src/components/IndexHeader/Nav/index.js b/src/components/IndexHeader/Nav/index.js
deleted file mode 100644
index d0b631592..000000000
--- a/src/components/IndexHeader/Nav/index.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import React, { Component } from 'react';
-import Link from 'react-router/lib/Link';
-import { connect } from 'react-redux';
-
-import { userType } from 'types';
-import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
-
-export class IndexHeaderNav extends Component {
- static propTypes = {
- user: userType
- };
-
- state = {
- open: false
- };
-
- openNav(event) {
- event.preventDefault();
-
- this.setState({ open: !this.state.open });
- }
-
- links() {
- const { user } = this.props;
- const classNames = `links ${this.state.open ? 'open' : ''}`;
-
- return (
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- {
- user &&
- -
-
- {user.firstName || user.name}
-
-
- }
-
- );
- }
-
- render() {
- return (
-
- {this.links()}
-
- );
- }
-}
-
-export default connect(
- state => ({
- user: state.auth.user
- })
-)(IndexHeaderNav);
diff --git a/src/components/IndexHeader/index.js b/src/components/IndexHeader/index.js
index d58ffb1ce..adbb0af15 100644
--- a/src/components/IndexHeader/index.js
+++ b/src/components/IndexHeader/index.js
@@ -4,8 +4,6 @@ import Link from 'react-router/lib/Link';
import SearchInput from 'components/SearchInput';
import debug from 'helpers/debug';
-import Nav from './Nav';
-
const logo = require('../../../static/images/logo-lg-w.png');
export default class IndexHeader extends Component {
@@ -28,7 +26,6 @@ export default class IndexHeader extends Component {
return (
-
diff --git a/src/components/InformationToggle/index.js b/src/components/InformationToggle/index.js
index 3ecbd885d..929b5cb30 100644
--- a/src/components/InformationToggle/index.js
+++ b/src/components/InformationToggle/index.js
@@ -1,33 +1,24 @@
-import React, { Component, PropTypes } from 'react';
-
+import React, { PropTypes } from 'react';
import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
-export default class InformationToggle extends Component {
- static propTypes = {
- isShowingSurahInfo: PropTypes.bool.isRequired,
- onToggle: PropTypes.func.isRequired
- };
-
- toggleInformationMode = (event) => {
- const { isShowingSurahInfo } = this.props;
-
- event.preventDefault();
-
- this.props.onToggle({ isShowingSurahInfo: !isShowingSurahInfo });
- };
+const InformationToggle = ({ isToggled, onToggle }) => (
+
+ onToggle({ isShowingSurahInfo: !isToggled })}
+ >
+
+ {' '}
+
+
+);
- render() {
- const { isShowingSurahInfo } = this.props;
+InformationToggle.propTypes = {
+ isToggled: PropTypes.bool.isRequired,
+ onToggle: PropTypes.func.isRequired
+};
- return (
-
-
-
- );
- }
-}
+export default InformationToggle;
diff --git a/src/components/Line/index.js b/src/components/Line/index.js
index 372e1fc71..c2600ef7d 100644
--- a/src/components/Line/index.js
+++ b/src/components/Line/index.js
@@ -11,8 +11,12 @@ export default class Line extends React.Component {
line: PropTypes.arrayOf(wordType).isRequired,
tooltip: PropTypes.string,
currentAyah: PropTypes.string.isRequired,
- audioActions: PropTypes.object.isRequired,
- currentWord: PropTypes.any,
+ audioActions: PropTypes.shape({
+ pause: PropTypes.func.isRequired,
+ setAyah: PropTypes.func.isRequired,
+ play: PropTypes.func.isRequired,
+ setCurrentWord: PropTypes.func.isRequired,
+ }),
isPlaying: PropTypes.bool
};
@@ -29,11 +33,16 @@ export default class Line extends React.Component {
renderText() {
const { tooltip, currentAyah, audioActions, isPlaying, line } = this.props;
- const text = line.map(word => {
- return (
-
- )
- });
+ const text = line.map(word => (
+
+ ));
return (
@@ -52,7 +61,7 @@ export default class Line extends React.Component {
return (
-
diff --git a/src/components/LocaleFormattedMessage/index.js b/src/components/LocaleFormattedMessage/index.js
index 23144529e..d2898c07f 100644
--- a/src/components/LocaleFormattedMessage/index.js
+++ b/src/components/LocaleFormattedMessage/index.js
@@ -1,17 +1,22 @@
import React, { PropTypes } from 'react';
import { intlShape, injectIntl, FormattedMessage } from 'react-intl';
-const LocaleFormattedMessage = ({ id, defaultMessage, intl, values }) => (
-
+const LocaleFormattedMessage = ({ id, defaultMessage, intl, values, className }) => (
+
);
LocaleFormattedMessage.propTypes = {
id: PropTypes.string.isRequired,
+ className: PropTypes.string,
defaultMessage: PropTypes.string,
intl: intlShape.isRequired,
values: PropTypes.object // eslint-disable-line
};
+LocaleFormattedMessage.defaultPropTypes = {
+ className: ''
+};
+
export default injectIntl(LocaleFormattedMessage);
diff --git a/src/components/LocaleSwitcher/index.js b/src/components/LocaleSwitcher/index.js
index 5c743f1f2..12ce4f84e 100644
--- a/src/components/LocaleSwitcher/index.js
+++ b/src/components/LocaleSwitcher/index.js
@@ -1,10 +1,15 @@
/* global window */
-import React, { Component } from 'react';
+import React, { PropTypes, Component } from 'react';
import cookie from 'react-cookie';
-import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
+import NavDropdown from 'react-bootstrap/lib/NavDropdown';
+import MenuItem from 'react-bootstrap/lib/MenuItem';
import { locales, defaultLocale } from '../../config';
export default class LocaleSwitcher extends Component {
+ static propTypes = {
+ className: PropTypes.string
+ };
+
state = {
currentLocale: defaultLocale,
};
@@ -31,36 +36,33 @@ export default class LocaleSwitcher extends Component {
window.location.reload();
}
- renderLocaleLink = (locale) => {
- let className = 'local-switch-link';
- if (locale === this.state.currentLocale) {
- className = `btn ${className} ${className}-active`;
- }
+ renderList() {
+ const keys = Object.keys(locales);
- return (
- this.handleLocaleClick(locale)}
- href={`?local=${locale}`}
+ return keys.map(key => (
+
- );
+ {locales[key]}
+
+ ));
}
render() {
- const keys = Object.keys(locales);
+ const { className } = this.props;
return (
-
-
-
-
-
- {keys.map(this.renderLocaleLink, this)}
-
+
+ {this.renderList()}
+
);
}
-
}
diff --git a/src/components/NightModeToggle/index.js b/src/components/NightModeToggle/index.js
index 545ca4366..23d41296a 100644
--- a/src/components/NightModeToggle/index.js
+++ b/src/components/NightModeToggle/index.js
@@ -1,24 +1,12 @@
/* global document */
import React, { Component } from 'react';
-import { intlShape, injectIntl } from 'react-intl';
-
import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
-import bindTooltip from 'utils/bindTooltip';
-
class NightModeToggle extends Component {
- static propTypes = {
- intl: intlShape.isRequired
- };
-
state = {
isNightMode: false,
};
- componentDidUpdate() {
- bindTooltip();
- }
-
toggleNightMode = () => {
document.body.classList.toggle('night-mode');
@@ -26,29 +14,21 @@ class NightModeToggle extends Component {
}
render() {
- const { intl } = this.props;
-
- const title = intl.formatMessage({
- id: this.state.isNightMode ? 'setting.nightMode.dayTip' : 'setting.nightMode.nightTip',
- defaultMessage: this.state.isNightMode ? 'Switch to day mode' : 'switch to night mode'
- });
-
return (
-
+
);
}
}
-export default injectIntl(NightModeToggle);
+export default NightModeToggle;
diff --git a/src/components/QuranNav/index.js b/src/components/QuranNav/index.js
deleted file mode 100644
index be31f08ab..000000000
--- a/src/components/QuranNav/index.js
+++ /dev/null
@@ -1,92 +0,0 @@
-import React, { PropTypes } from 'react';
-import { connect } from 'react-redux';
-import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
-import Navbar from 'react-bootstrap/lib/Navbar';
-import Nav from 'react-bootstrap/lib/Nav';
-import NavDropdown from 'react-bootstrap/lib/NavDropdown';
-import MenuItem from 'react-bootstrap/lib/MenuItem';
-import NavItem from 'react-bootstrap/lib/NavItem';
-import Image from 'react-bootstrap/lib/Image';
-import userType from 'types/userType';
-import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
-
-const Header = Navbar.Header;
-const Collapse = Navbar.Collapse;
-const Toggle = Navbar.Toggle;
-
-
-const styles = require('./style.scss');
-
-export const QuranNav = ({ user }) => (
-
-
-
-
-
- }
- id="user-dropdown"
- >
-
-
-
-
-
- }
-
-
-
-);
-
-QuranNav.propTypes = {
- user: PropTypes.shape(userType)
-};
-
-export default connect(
- state => ({
- user: state.auth.user
- })
-)(QuranNav);
diff --git a/src/components/QuranNav/style.scss b/src/components/QuranNav/style.scss
deleted file mode 100644
index 58612775b..000000000
--- a/src/components/QuranNav/style.scss
+++ /dev/null
@@ -1,27 +0,0 @@
-$navbar-height: 40px;
-.nav {
- min-height: $navbar-height;
- border-radius: 0px;
- margin-bottom: 0px;
-
- :global(.navbar-nav > li > a) {
- padding-top: ($navbar-height - 20) / 2;
- padding-bottom: ($navbar-height - 20) / 2;
- }
-
- &.transparent{
- background: transparent;
- }
-}
-
-.name{
- padding-left: 25px;
-}
-
-.image{
- width: 30px;
- position: absolute;
- left: 5px;
- top: 50%;
- transform: translateY(-50%);
-}
diff --git a/src/components/Radio/index.js b/src/components/Radio/index.js
new file mode 100644
index 000000000..1d94fb551
--- /dev/null
+++ b/src/components/Radio/index.js
@@ -0,0 +1,30 @@
+import React, { PropTypes } from 'react';
+
+const styles = require('./style.scss');
+
+const Radio = ({ id, name, checked, handleChange, children }) => (
+
+);
+
+Radio.propTypes = {
+ id: PropTypes.string.isRequired,
+ name: PropTypes.string.isRequired,
+ checked: PropTypes.bool.isRequired,
+ handleChange: PropTypes.func.isRequired,
+ children: PropTypes.element.isRequired,
+};
+
+export default Radio;
diff --git a/src/components/Radio/style.scss b/src/components/Radio/style.scss
new file mode 100644
index 000000000..a00b1fdee
--- /dev/null
+++ b/src/components/Radio/style.scss
@@ -0,0 +1,130 @@
+@import '../../styles/variables.scss';
+
+@-webkit-keyframes cardEnter {
+ 0%, 20%, 40%, 60%, 80%, 100% {
+ -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+ 0% {
+ opacity: 0;
+ -webkit-transform: scale3d(0.3, 0.3, 0.3);
+ }
+ 20% {
+ -webkit-transform: scale3d(1.1, 1.1, 1.1);
+ }
+ 40% {
+ -webkit-transform: scale3d(0.9, 0.9, 0.9);
+ }
+ 60% {
+ opacity: 1;
+ -webkit-transform: scale3d(1.03, 1.03, 1.03);
+ }
+ 80% {
+ -webkit-transform: scale3d(0.97, 0.97, 0.97);
+ }
+ 100% {
+ opacity: 1;
+ -webkit-transform: scale3d(1, 1, 1);
+ }
+}
+
+@keyframes cardEnter {
+ 0%, 20%, 40%, 60%, 80%, 100% {
+ -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+ 0% {
+ opacity: 0;
+ -webkit-transform: scale3d(0.3, 0.3, 0.3);
+ transform: scale3d(0.3, 0.3, 0.3);
+ }
+ 20% {
+ -webkit-transform: scale3d(1.1, 1.1, 1.1);
+ transform: scale3d(1.1, 1.1, 1.1);
+ }
+ 40% {
+ -webkit-transform: scale3d(0.9, 0.9, 0.9);
+ transform: scale3d(0.9, 0.9, 0.9);
+ }
+ 60% {
+ opacity: 1;
+ -webkit-transform: scale3d(1.03, 1.03, 1.03);
+ transform: scale3d(1.03, 1.03, 1.03);
+ }
+ 80% {
+ -webkit-transform: scale3d(0.97, 0.97, 0.97);
+ transform: scale3d(0.97, 0.97, 0.97);
+ }
+ 100% {
+ opacity: 1;
+ -webkit-transform: scale3d(1, 1, 1);
+ transform: scale3d(1, 1, 1);
+ }
+}
+
+.radio {
+ display: inline-block;
+ padding-right: 20px;
+ font-weight: 500;
+ color: #777;
+ line-height: 40px;
+ cursor: pointer;
+}
+
+.radio:hover .inner {
+ -webkit-transform: scale(0.5);
+ -ms-transform: scale(0.5);
+ transform: scale(0.5);
+ opacity: .5;
+}
+
+.radio .input {
+ width: 1px;
+ height: 1px;
+ opacity: 0;
+}
+
+.radio .input:checked + .outer .inner {
+ -webkit-transform: scale(1);
+ -ms-transform: scale(1);
+ transform: scale(1);
+ opacity: 1;
+}
+
+.radio .input:checked + .outer {
+ border: 2px solid $brand-primary;
+}
+
+.radio .input:focus + .outer .inner {
+ -webkit-transform: scale(1);
+ -ms-transform: scale(1);
+ transform: scale(1);
+ opacity: 1;
+ background-color: $brand-primary;
+}
+
+.radio .outer {
+ width: 20px;
+ height: 20px;
+ display: block;
+ float: left;
+ margin: 10px 9px 10px 10px;
+ border: 2px solid $brand-primary;
+ border-radius: 50%;
+ background-color: #fff;
+}
+
+.radio .inner {
+ -webkit-transition: all 0.25s ease-in-out;
+ transition: all 0.25s ease-in-out;
+ width: 10px;
+ height: 10px;
+ -webkit-transform: scale(0);
+ -ms-transform: scale(0);
+ transform: scale(0);
+ display: block;
+ margin: 3px;
+ border-radius: 50%;
+ background-color: $brand-primary;
+ opacity: 0;
+}
diff --git a/src/components/ReadingModeToggle/index.js b/src/components/ReadingModeToggle/index.js
index a27db924d..ff75185c0 100644
--- a/src/components/ReadingModeToggle/index.js
+++ b/src/components/ReadingModeToggle/index.js
@@ -1,22 +1,23 @@
import React, { PropTypes } from 'react';
-
-import SwitchToggle from 'components/SwitchToggle';
import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
-const ReadingModeToggle = ({ onReadingModeToggle, isToggled }) => (
-
- :{' '}
-
-
+const ReadingModeToggle = ({ onToggle, isToggled }) => (
+
+ onToggle({ isReadingMode: !isToggled })}
+ >
+
+ {' '}
+
+
);
ReadingModeToggle.propTypes = {
- onReadingModeToggle: PropTypes.func.isRequired,
+ onToggle: PropTypes.func.isRequired,
isToggled: PropTypes.bool.isRequired
};
diff --git a/src/components/ReciterDropdown/index.js b/src/components/ReciterDropdown/index.js
index 7e1fb52bd..3f11060ff 100644
--- a/src/components/ReciterDropdown/index.js
+++ b/src/components/ReciterDropdown/index.js
@@ -1,10 +1,8 @@
import React, { Component, PropTypes } from 'react';
+import ButtonToolbar from 'react-bootstrap/lib/ButtonToolbar';
import DropdownButton from 'react-bootstrap/lib/DropdownButton';
import MenuItem from 'react-bootstrap/lib/MenuItem';
-import LocaleFormattedMessage from 'components/LocaleFormattedMessage';
-import { optionsType } from 'types';
-
const style = require('./style.scss');
// To save API calls.
@@ -194,25 +192,17 @@ export const slugs = [
export default class ReciterDropdown extends Component {
static propTypes = {
onOptionChange: PropTypes.func,
- options: optionsType,
+ audio: PropTypes.number,
className: PropTypes.string
};
- static defaultProps = {
- className: 'col-md-3'
- };
-
- shouldComponentUpdate(nextProps) {
- return this.props.options !== nextProps.options;
- }
-
renderMenu() {
- const { options, onOptionChange } = this.props;
+ const { audio, onOptionChange } = this.props;
return slugs.map(slug => (