summaryrefslogtreecommitdiffstats
path: root/ui/src/components/login.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-08-13 19:52:43 -0700
committerDessalines <tyhou13@gmx.com>2019-08-13 19:52:43 -0700
commitd7ab85ab70478f1ec440c920d726d08b145cef5e (patch)
treecc799c34a29c4e6070a3f3a34823e7c091cddaad /ui/src/components/login.tsx
parentad4dbbcd7726e75aea1e06111a1af3039cbeca70 (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/login.tsx')
-rw-r--r--ui/src/components/login.tsx15
1 files changed, 14 insertions, 1 deletions
diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx
index e7af89ca..66962acc 100644
--- a/ui/src/components/login.tsx
+++ b/ui/src/components/login.tsx
@@ -28,6 +28,7 @@ export class Login extends Component<any, State> {
password: undefined,
password_verify: undefined,
admin: false,
+ show_nsfw: false,
},
loginLoading: false,
registerLoading: false,
@@ -127,9 +128,16 @@ export class Login extends Component<any, State> {
</div>
<div class="form-group row">
<div class="col-sm-10">
+ <div class="form-check">
+ <input class="form-check-input" type="checkbox" checked={this.state.registerForm.show_nsfw} onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}/>
+ <label class="form-check-label"><T i18nKey="show_nsfw">#</T></label>
+ </div>
+ </div>
+ </div>
+ <div class="form-group row">
+ <div class="col-sm-10">
<button type="submit" class="btn btn-secondary">{this.state.registerLoading ?
<svg class="icon icon-spinner spin"><use xlinkHref="#icon-spinner"></use></svg> : i18n.t('sign_up')}</button>
-
</div>
</div>
</form>
@@ -181,6 +189,11 @@ export class Login extends Component<any, State> {
i.setState(i.state);
}
+ handleRegisterShowNsfwChange(i: Login, event: any) {
+ i.state.registerForm.show_nsfw = event.target.checked;
+ i.setState(i.state);
+ }
+
parseMessage(msg: any) {
let op: UserOperation = msgOp(msg);
if (msg.error) {