-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add digest category to email notifications settings
- Loading branch information
1 parent
3eba639
commit a6f9789
Showing
2 changed files
with
95 additions
and
48 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
client/me/notification-settings/wpcom-settings/email-category.jsx
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 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import FormCheckbox from 'components/forms/form-checkbox'; | ||
import FormFieldset from 'components/forms/form-fieldset'; | ||
import FormLegend from 'components/forms/form-legend'; | ||
import FormLabel from 'components/forms/form-label'; | ||
import { toggleWPcomEmailSetting } from 'lib/notification-settings-store/actions'; | ||
|
||
const EmailCategory = React.createClass( { | ||
propTypes() { | ||
return { | ||
name: React.PropTypes.string, | ||
isEnabled: React.PropTypes.bool, | ||
title: React.PropTypes.string, | ||
description: React.PropTypes.string | ||
}; | ||
}, | ||
|
||
toggleSetting() { | ||
toggleWPcomEmailSetting( this.props.name ); | ||
}, | ||
|
||
render() { | ||
return ( | ||
<FormFieldset> | ||
<FormLegend>{ this.props.title }</FormLegend> | ||
<FormLabel> | ||
<FormCheckbox checked={ this.props.isEnabled } onChange={ this.toggleSetting } /> | ||
<span>{ this.props.description }</span> | ||
</FormLabel> | ||
</FormFieldset> | ||
); | ||
} | ||
} ); | ||
|
||
export default EmailCategory; |
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