This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from naveed-ahmad/night-mode
Night mode
- Loading branch information
Showing
132 changed files
with
4,629 additions
and
19,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
.controlItem{ | ||
vertical-align: middle; | ||
padding-right: 20px; | ||
color: #939598; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
|
||
import SwitchToggle from 'components/SwitchToggle'; | ||
|
||
export default class NightModeToggle extends Component { | ||
static propTypes = { | ||
isNightMode: PropTypes.bool.isRequired, | ||
onToggle: PropTypes.func.isRequired | ||
}; | ||
|
||
static defaultProps = { | ||
isNightMode: false | ||
}; | ||
|
||
toggleNightMode = () => { | ||
const { isNightMode } = this.props; | ||
|
||
if(isNightMode) | ||
document.body.classList.add('night-mode'); | ||
else | ||
document.body.classList.remove('night-mode'); | ||
|
||
this.props.onToggle({isNightMode: !isNightMode}); | ||
} | ||
|
||
render() { | ||
const { isNightMode } = this.props; | ||
|
||
return( | ||
<div> | ||
<a | ||
title={isNightMode ? "Switch to day mode" : "Switch to night mode"} | ||
className={`${isNightMode ? 'text-primary' : 'text-color'} pointer`} | ||
onClick={this.toggleNightMode} | ||
> | ||
Night Mode:{' '} | ||
<i className="ss-icon ss-lightbulb"/> | ||
</a> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const TOGGLE_READING_MODE = '@@quran/options/TOGGLE_READING_MODE'; | ||
export const SET_OPTION = '@@quran/options/SET_OPTION'; | ||
export const TOGGLE_NIGHT_MODE = '@@quran/options/TOGGLE_NIGHT_MODE'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.