mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-26 06:11:15 +00:00
Only show downvotes setting if site has downvotes enabled.
This commit is contained in:
parent
03f060ade2
commit
f35c8a3add
1 changed files with 24 additions and 17 deletions
|
@ -1,5 +1,6 @@
|
||||||
import {
|
import {
|
||||||
communityToChoice,
|
communityToChoice,
|
||||||
|
enableDownvotes,
|
||||||
fetchCommunities,
|
fetchCommunities,
|
||||||
fetchThemeList,
|
fetchThemeList,
|
||||||
fetchUsers,
|
fetchUsers,
|
||||||
|
@ -714,6 +715,7 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
|
||||||
|
|
||||||
saveUserSettingsHtmlForm() {
|
saveUserSettingsHtmlForm() {
|
||||||
const selectedLangs = this.state.saveUserSettingsForm.discussion_languages;
|
const selectedLangs = this.state.saveUserSettingsForm.discussion_languages;
|
||||||
|
const siteRes = this.state.siteRes;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -746,8 +748,8 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
|
||||||
onContentChange={this.handleBioChange}
|
onContentChange={this.handleBioChange}
|
||||||
maxLength={300}
|
maxLength={300}
|
||||||
hideNavigationWarnings
|
hideNavigationWarnings
|
||||||
allLanguages={this.state.siteRes.all_languages}
|
allLanguages={siteRes.all_languages}
|
||||||
siteLanguages={this.state.siteRes.discussion_languages}
|
siteLanguages={siteRes.discussion_languages}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -843,8 +845,8 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<LanguageSelect
|
<LanguageSelect
|
||||||
allLanguages={this.state.siteRes.all_languages}
|
allLanguages={siteRes.all_languages}
|
||||||
siteLanguages={this.state.siteRes.discussion_languages}
|
siteLanguages={siteRes.discussion_languages}
|
||||||
selectedLanguageIds={selectedLangs}
|
selectedLanguageIds={selectedLangs}
|
||||||
multiple={true}
|
multiple={true}
|
||||||
showLanguageWarning={true}
|
showLanguageWarning={true}
|
||||||
|
@ -979,6 +981,7 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{enableDownvotes(siteRes) && (
|
||||||
<div className="input-group mb-3">
|
<div className="input-group mb-3">
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input
|
<input
|
||||||
|
@ -988,11 +991,15 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
|
||||||
checked={this.state.saveUserSettingsForm.show_downvotes}
|
checked={this.state.saveUserSettingsForm.show_downvotes}
|
||||||
onChange={linkEvent(this, this.handleShowDownvotesChange)}
|
onChange={linkEvent(this, this.handleShowDownvotesChange)}
|
||||||
/>
|
/>
|
||||||
<label className="form-check-label" htmlFor="user-show-downvotes">
|
<label
|
||||||
|
className="form-check-label"
|
||||||
|
htmlFor="user-show-downvotes"
|
||||||
|
>
|
||||||
{I18NextService.i18n.t("show_downvotes")}
|
{I18NextService.i18n.t("show_downvotes")}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
<div className="input-group mb-3">
|
<div className="input-group mb-3">
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input
|
<input
|
||||||
|
|
Loading…
Reference in a new issue