From ea855ecda2c3df9e5d0881d43e2fdbceb9dccafc Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Wed, 5 Aug 2020 22:25:24 -0500 Subject: finishing touches on settings --- src/client/util/SettingsManager.scss | 30 +++++++++++++- src/client/util/SettingsManager.tsx | 78 +++++++++++++++++++++++++++--------- 2 files changed, 87 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/client/util/SettingsManager.scss b/src/client/util/SettingsManager.scss index 41bce8a1b..2d0fb4e95 100644 --- a/src/client/util/SettingsManager.scss +++ b/src/client/util/SettingsManager.scss @@ -30,10 +30,36 @@ } .settings-username { - font-size: 14px; + font-size: 12px; padding-right: 15px; color: black; - margin-top: 10px; + margin-top: 4px; + /* right: 135; */ + position: absolute; + left: 235; +} + +.grey-submit { + width: 71.1875px; + align-self: center; + background: #75787c; + outline: none; + border-radius: 5px; + border: 0px; + color: #fcfbf7; + text-transform: uppercase; + letter-spacing: 2px; + font-size: 75%; + padding: 10px; + transition: transform 0.2s; + margin: 2px; + margin-left: 85px; + height: 32px; + + &:hover { + cursor: not-allowed; + } + } .settings-section { diff --git a/src/client/util/SettingsManager.tsx b/src/client/util/SettingsManager.tsx index 68ed32c0f..155c7f60c 100644 --- a/src/client/util/SettingsManager.tsx +++ b/src/client/util/SettingsManager.tsx @@ -39,6 +39,9 @@ export default class SettingsManager extends React.Component<{}> { private new_password_ref = React.createRef(); private new_confirm_ref = React.createRef(); + @observable private curr_password: string = ""; + @observable private new_password: string = ""; + @observable private new_confirm: string = ""; @computed get backgroundColor() { return Doc.UserDoc().defaultColor; } @@ -142,25 +145,44 @@ export default class SettingsManager extends React.Component<{}> { return true; } - private get settingsInterface() { + @computed get allowSubmit() { + return this.curr_password.length > 3 && + this.new_password.length > 3 && + this.new_confirm.length > 3 && this.new_confirm === this.new_password && + this.new_password !== this.curr_password ? true : false; + } + @action + changeVal = (e: any, pass: string) => { + if (pass === "curr") { + this.curr_password = e.target.value; + } else if (pass === "new") { + this.new_password = e.target.value; + } else if (pass === "conf") { + this.new_confirm = e.target.value; + } + } - const passwordContent =
+ @computed get passwordContent() { + return
- - - + this.changeVal(e, "curr")} ref={this.curr_password_ref} /> + this.changeVal(e, "new")} ref={this.new_password_ref} /> + this.changeVal(e, "conf")} ref={this.new_confirm_ref} />
{this.errorText ?
{this.errorText}
: undefined} {this.successText ?
{this.successText}
: undefined} - + {this.allowSubmit ? :
submit
} forgot password?
; + } - const modesContent =
+ @computed get modesContent() { + return
-
+
;
; + return preferencesContent; + } + + + @computed private get settingsInterface() { + return (
Settings
-
{Doc.CurrentUserEmail}
+
+
Signed in as:
+
{Doc.CurrentUserEmail}
+
@@ -245,19 +285,19 @@ export default class SettingsManager extends React.Component<{}> {
Password
-
{passwordContent}
+
{this.passwordContent}
Modes
-
{modesContent}
+
{this.modesContent}
Accounts
-
{accountsContent}
+
{this.accountsContent}
Preferences
-
{preferencesContent}
+
{this.preferencesContent}
); -- cgit v1.2.3-70-g09d2