Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 45ef788

Browse files
naveed-ahmadahmedre
authored andcommittedMay 23, 2017
fixed close drawer (#795)
1 parent 9418351 commit 45ef788

File tree

2 files changed

+52
-28
lines changed

2 files changed

+52
-28
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"promise": "7.1.1",
105105
"proxy-middleware": "0.14.0",
106106
"qs": "6.2.1",
107-
"quran-components": "^0.0.69",
107+
"quran-components": "^0.0.73",
108108
"raven": "1.1.1",
109109
"raw-loader": "0.5.1",
110110
"react": "15.4.1",

‎src/components/GlobalNav/Surah/index.js

+51-27
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const styles = require('../style.scss');
2727
class GlobalNavSurah extends Component {
2828
state = {
2929
drawerOpen: false
30-
}
30+
};
3131

3232
handleOptionChange = (payload) => {
3333
const { chapter, setOption, options, versesIds } = this.props;
@@ -37,8 +37,11 @@ class GlobalNavSurah extends Component {
3737
if (chapter) {
3838
const from = [...versesIds][0];
3939
const to = [...versesIds][[...versesIds].length - 1];
40-
const paging = { offset: from - 1, limit: (to - from) + 1 };
41-
this.props.load(chapter.chapterNumber, paging, { ...options, ...payload });
40+
const paging = { offset: from - 1, limit: to - from + 1 };
41+
this.props.load(chapter.chapterNumber, paging, {
42+
...options,
43+
...payload
44+
});
4245
}
4346
};
4447

@@ -51,12 +54,14 @@ class GlobalNavSurah extends Component {
5154
return false;
5255
}
5356

54-
return this.props.replace(`/${chapter.chapterNumber}/${verseNum}-${verseNum + 10}`);
55-
}
57+
return this.props.replace(
58+
`/${chapter.chapterNumber}/${verseNum}-${verseNum + 10}`
59+
);
60+
};
5661

5762
handleDrawerToggle = (open) => {
5863
this.setState({ drawerOpen: open });
59-
}
64+
};
6065

6166
renderDrawerToggle(visibleXs) {
6267
return (
@@ -67,14 +72,24 @@ class GlobalNavSurah extends Component {
6772
onClick={() => this.handleDrawerToggle(true)}
6873
>
6974
<i className="ss-icon ss-settings text-align" />
70-
<LocaleFormattedMessage id="setting.title" defaultMessage="Settings" />
75+
<LocaleFormattedMessage
76+
id="setting.title"
77+
defaultMessage="Settings"
78+
/>
7179
</a>
7280
</li>
7381
);
7482
}
7583

7684
render() {
77-
const { chapter, chapters, setOption, versesIds, options, ...props } = this.props;
85+
const {
86+
chapter,
87+
chapters,
88+
setOption,
89+
versesIds,
90+
options,
91+
...props
92+
} = this.props;
7893

7994
return (
8095
<GlobalNav
@@ -92,7 +107,10 @@ class GlobalNavSurah extends Component {
92107
</div>,
93108
<li className="visible-xs-inline-block visible-sm-inline-block">
94109
<Link to="/search">
95-
<i className="ss-icon ss-search" style={{ verticalAlign: 'sub' }} />
110+
<i
111+
className="ss-icon ss-search"
112+
style={{ verticalAlign: 'sub' }}
113+
/>
96114
</Link>
97115
</li>,
98116
this.renderDrawerToggle(true),
@@ -102,10 +120,15 @@ class GlobalNavSurah extends Component {
102120
open={this.state.drawerOpen}
103121
handleOpen={this.handleDrawerToggle}
104122
toggle={<noscript />}
123+
header={
124+
<h4>
125+
<LocaleFormattedMessage
126+
id="setting.title"
127+
defaultMessage="Settings"
128+
/>
129+
</h4>
130+
}
105131
>
106-
<div style={{ padding: 15 }}>
107-
<h4><LocaleFormattedMessage id="setting.title" defaultMessage="Settings" /></h4>
108-
</div>
109132
<Menu>
110133
<InformationToggle
111134
onToggle={setOption}
@@ -120,19 +143,18 @@ class GlobalNavSurah extends Component {
120143
onToggle={setOption}
121144
/>
122145
<hr />
123-
<ReciterDropdown
124-
onOptionChange={this.handleOptionChange}
125-
/>
126-
<ContentDropdown
127-
onOptionChange={this.handleOptionChange}
128-
/>
146+
<ReciterDropdown onOptionChange={this.handleOptionChange} />
147+
<ContentDropdown onOptionChange={this.handleOptionChange} />
129148
<TooltipDropdown
130149
tooltip={options.tooltip}
131150
onOptionChange={setOption}
132151
/>
133152
<hr />
134153
<div className={styles.title}>
135-
<LocaleFormattedMessage id="setting.fontSize" defaultMessage="Font Size" />
154+
<LocaleFormattedMessage
155+
id="setting.fontSize"
156+
defaultMessage="Font Size"
157+
/>
136158
</div>
137159
<FontSizeDropdown
138160
fontSize={options.fontSize}
@@ -141,9 +163,7 @@ class GlobalNavSurah extends Component {
141163
</Menu>
142164
</Drawer>
143165
]}
144-
rightControls={[
145-
this.renderDrawerToggle()
146-
]}
166+
rightControls={[this.renderDrawerToggle()]}
147167
/>
148168
);
149169
}
@@ -153,7 +173,9 @@ function mapStateToProps(state, ownProps) {
153173
const chapterId = parseInt(ownProps.params.chapterId, 10);
154174
const chapter: Object = state.chapters.entities[chapterId];
155175
const verses: Object = state.verses.entities[chapterId];
156-
const versesArray = verses ? Object.keys(verses).map(key => parseInt(key.split(':')[1], 10)) : [];
176+
const versesArray = verses
177+
? Object.keys(verses).map(key => parseInt(key.split(':')[1], 10))
178+
: [];
157179
const versesIds = new Set(versesArray);
158180

159181
return {
@@ -175,7 +197,9 @@ GlobalNavSurah.propTypes = {
175197
replace: PropTypes.func.isRequired
176198
};
177199

178-
export default connect(
179-
mapStateToProps,
180-
{ ...OptionsActions, load, replace, setCurrentVerse }
181-
)(GlobalNavSurah);
200+
export default connect(mapStateToProps, {
201+
...OptionsActions,
202+
load,
203+
replace,
204+
setCurrentVerse
205+
})(GlobalNavSurah);

0 commit comments

Comments
 (0)
This repository has been archived.