diff --git a/patches/login/matrix-react-sdk+3.71.1.patch b/patches/login/matrix-react-sdk+3.71.1.patch index 765a85854..5f8e23416 100644 --- a/patches/login/matrix-react-sdk+3.71.1.patch +++ b/patches/login/matrix-react-sdk+3.71.1.patch @@ -89,11 +89,22 @@ index 4314726..0a34f0e 100644 {footer} diff --git a/node_modules/matrix-react-sdk/src/components/views/auth/PasswordLogin.tsx b/node_modules/matrix-react-sdk/src/components/views/auth/PasswordLogin.tsx -index 7275055..bb8f0ad 100644 +index 7275055..93c08bb 100644 --- a/node_modules/matrix-react-sdk/src/components/views/auth/PasswordLogin.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/auth/PasswordLogin.tsx -@@ -85,7 +85,10 @@ export default class PasswordLogin extends React.PureComponent { +@@ -50,6 +50,7 @@ interface IProps { + } + + interface IState { ++ displayPassword: boolean; + fieldValid: Partial>; + loginType: LoginField.Email | LoginField.MatrixId | LoginField.Phone; + password: string; +@@ -83,13 +84,21 @@ export default class PasswordLogin extends React.PureComponent { + public constructor(props: IProps) { + super(props); this.state = { ++ displayPassword: false, // Field error codes by field ID fieldValid: {}, - loginType: LoginField.MatrixId, @@ -104,7 +115,15 @@ index 7275055..bb8f0ad 100644 password: "", }; } -@@ -420,7 +423,11 @@ export default class PasswordLogin extends React.PureComponent { + ++ private setDisplayPassword = (value: boolean): void => { ++ this.setState({ displayPassword: value }); ++ }; ++ + private onForgotPasswordClick = (ev: ButtonEvent): void => { + ev.preventDefault(); + ev.stopPropagation(); +@@ -420,13 +429,17 @@ export default class PasswordLogin extends React.PureComponent { return (
@@ -117,3 +136,31 @@ index 7275055..bb8f0ad 100644 {loginField} { + autoFocus={autoFocusPassword} + onValidate={this.onPasswordValidate} + ref={(field) => (this[LoginField.Password] = field)} ++ postfixComponent={( ++
this.setDisplayPassword(true)} ++ onMouseUp={() => this.setDisplayPassword(false)} ++ > ++ {_t("Eye")} ++
++ )} + /> + {forgotPasswordJsx} + {!this.props.busy && ( diff --git a/patches/patches.json b/patches/patches.json index a9234baa5..c21cbc52a 100644 --- a/patches/patches.json +++ b/patches/patches.json @@ -208,4 +208,4 @@ "src/stores/RoomViewStore.tsx" ] } -} +} \ No newline at end of file diff --git a/patches/ux-improvements-for-xsss/matrix-react-sdk+3.71.1.patch b/patches/ux-improvements-for-xsss/matrix-react-sdk+3.71.1.patch index bc659a2a6..887534efc 100644 --- a/patches/ux-improvements-for-xsss/matrix-react-sdk+3.71.1.patch +++ b/patches/ux-improvements-for-xsss/matrix-react-sdk+3.71.1.patch @@ -1,9 +1,61 @@ diff --git a/node_modules/matrix-react-sdk/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/node_modules/matrix-react-sdk/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx -index a261e44..e6eec36 100644 +index a261e44..88c0b33 100644 --- a/node_modules/matrix-react-sdk/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx -@@ -413,13 +413,15 @@ export default class AccessSecretStorageDialog extends React.PureComponent { ++ this.setState({ displayPassword: value }); ++ }; ++ + private onCancel = (): void => { + if (this.state.resetting) { + this.setState({ resetting: false }); +@@ -403,7 +409,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent +
+ this.setDisplayPassword(true)} ++ onMouseUp={() => this.setDisplayPassword(false)} ++ > ++ {_t("Eye")} ++
++ )} />
+ {/* @@ -19,7 +71,7 @@ index a261e44..e6eec36 100644 {_t("Upload")} diff --git a/res/img/grey-eye.svg b/res/img/grey-eye.svg new file mode 100644 index 000000000..9f9acc61c --- /dev/null +++ b/res/img/grey-eye.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/res/themes/tchap-common/css/_tchap_custom.pcss b/res/themes/tchap-common/css/_tchap_custom.pcss index 153460604..a26f3a78d 100644 --- a/res/themes/tchap-common/css/_tchap_custom.pcss +++ b/res/themes/tchap-common/css/_tchap_custom.pcss @@ -19,3 +19,12 @@ color: $alert important!; text-decoration: underline important!; } + +/* Wrapper for eye in password inputs to show wrong password on press */ +.tc_textInput_postfixComponent { + align-items: center; + display: flex; + height: 100%; + justify-content: center; + padding: 0 3px; +}