diff options
author | Dessalines <tyhou13@gmx.com> | 2019-08-13 19:52:43 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-08-13 19:52:43 -0700 |
commit | d7ab85ab70478f1ec440c920d726d08b145cef5e (patch) | |
tree | cc799c34a29c4e6070a3f3a34823e7c091cddaad /ui/src/components/community-form.tsx | |
parent | ad4dbbcd7726e75aea1e06111a1af3039cbeca70 (diff) |
Squashed commit of the following:
commit ecd6c5a2f47cbbb2fc4bf482fadd78380303a904
Author: Dessalines <happydooby@gmail.com>
Date: Tue Aug 13 19:49:38 2019 -0700
Adding some docs
commit 3babd09affb1920da3d0a0ceb7e24c8aeeb9cf1a
Author: Dessalines <happydooby@gmail.com>
Date: Tue Aug 13 19:28:46 2019 -0700
Adding save user settings
commit 6e8da9cc9e522d0da668bfa31944c3348cc79620
Merge: 3246d5d c148eef
Author: Dessalines <happydooby@gmail.com>
Date: Tue Aug 13 17:26:25 2019 -0700
Merge branch 'dev' into nsfw
commit b3d4a5c4ce441bcc664704aba44cedb51d887599
Author: Dessalines <happydooby@gmail.com>
Date: Sun Aug 11 20:55:09 2019 -0700
nsfw mostly done, except for settings page.
Diffstat (limited to 'ui/src/components/community-form.tsx')
-rw-r--r-- | ui/src/components/community-form.tsx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx index b039fb4d..833d8a3f 100644 --- a/ui/src/components/community-form.tsx +++ b/ui/src/components/community-form.tsx @@ -30,7 +30,8 @@ export class CommunityForm extends Component<CommunityFormProps, CommunityFormSt communityForm: { name: null, title: null, - category_id: null + category_id: null, + nsfw: false, }, categories: [], loading: false @@ -48,6 +49,7 @@ export class CommunityForm extends Component<CommunityFormProps, CommunityFormSt category_id: this.props.community.category_id, description: this.props.community.description, edit_id: this.props.community.id, + nsfw: this.props.community.nsfw, auth: null } } @@ -105,6 +107,14 @@ export class CommunityForm extends Component<CommunityFormProps, CommunityFormSt </div> <div class="form-group row"> <div class="col-12"> + <div class="form-check"> + <input class="form-check-input" type="checkbox" checked={this.state.communityForm.nsfw} onChange={linkEvent(this, this.handleCommunityNsfwChange)}/> + <label class="form-check-label"><T i18nKey="nsfw">#</T></label> + </div> + </div> + </div> + <div class="form-group row"> + <div class="col-12"> <button type="submit" class="btn btn-secondary mr-2"> {this.state.loading ? <svg class="icon icon-spinner spin"><use xlinkHref="#icon-spinner"></use></svg> : @@ -147,6 +157,11 @@ export class CommunityForm extends Component<CommunityFormProps, CommunityFormSt i.setState(i.state); } + handleCommunityNsfwChange(i: CommunityForm, event: any) { + i.state.communityForm.nsfw = event.target.checked; + i.setState(i.state); + } + handleCancel(i: CommunityForm) { i.props.onCancel(); } |