mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 22:01:13 +00:00
Merge branch 'main' into add_open_links_in_new_tab_1
This commit is contained in:
commit
4ba0d55a7a
6 changed files with 16 additions and 5 deletions
|
@ -14,6 +14,7 @@ interface PasswordInputProps {
|
|||
showStrength?: boolean;
|
||||
label?: string | null;
|
||||
showForgotLink?: boolean;
|
||||
isNew?: boolean;
|
||||
}
|
||||
|
||||
interface PasswordInputState {
|
||||
|
@ -73,6 +74,7 @@ class PasswordInput extends Component<PasswordInputProps, PasswordInputState> {
|
|||
showStrength,
|
||||
label,
|
||||
showForgotLink,
|
||||
isNew,
|
||||
},
|
||||
state: { show },
|
||||
} = this;
|
||||
|
@ -91,7 +93,7 @@ class PasswordInput extends Component<PasswordInputProps, PasswordInputState> {
|
|||
type={show ? "text" : "password"}
|
||||
className="form-control"
|
||||
aria-describedby={id}
|
||||
autoComplete="on"
|
||||
autoComplete={isNew ? "new-password" : "current-password"}
|
||||
onInput={onInput}
|
||||
value={value}
|
||||
required
|
||||
|
|
|
@ -128,6 +128,7 @@ export class Setup extends Component<any, State> {
|
|||
value={this.state.form.password}
|
||||
onInput={linkEvent(this, this.handleRegisterPasswordChange)}
|
||||
label={I18NextService.i18n.t("password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
|
@ -136,6 +137,7 @@ export class Setup extends Component<any, State> {
|
|||
value={this.state.form.password_verify}
|
||||
onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)}
|
||||
label={I18NextService.i18n.t("verify_password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3 row">
|
||||
|
|
|
@ -189,6 +189,7 @@ export class Signup extends Component<any, State> {
|
|||
onInput={linkEvent(this, this.handleRegisterPasswordChange)}
|
||||
showStrength
|
||||
label={I18NextService.i18n.t("password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -198,6 +199,7 @@ export class Signup extends Component<any, State> {
|
|||
value={this.state.form.password_verify}
|
||||
onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)}
|
||||
label={I18NextService.i18n.t("verify_password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ export class PasswordChange extends Component<any, State> {
|
|||
onInput={linkEvent(this, this.handlePasswordChange)}
|
||||
showStrength
|
||||
label={I18NextService.i18n.t("new_password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
|
|
|
@ -265,7 +265,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
);
|
||||
}
|
||||
|
||||
userSettings(isSelected) {
|
||||
userSettings(isSelected: boolean) {
|
||||
return (
|
||||
<div
|
||||
className={classNames("tab-pane show", {
|
||||
|
@ -290,7 +290,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
);
|
||||
}
|
||||
|
||||
blockCards(isSelected) {
|
||||
blockCards(isSelected: boolean) {
|
||||
return (
|
||||
<div
|
||||
className={classNames("tab-pane", {
|
||||
|
@ -327,6 +327,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
onInput={linkEvent(this, this.handleNewPasswordChange)}
|
||||
showStrength
|
||||
label={I18NextService.i18n.t("new_password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
|
@ -335,6 +336,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
value={this.state.changePasswordForm.new_password_verify}
|
||||
onInput={linkEvent(this, this.handleNewPasswordVerifyChange)}
|
||||
label={I18NextService.i18n.t("verify_password")}
|
||||
isNew
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
|
|
|
@ -582,8 +582,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
case "loading":
|
||||
return <Spinner />;
|
||||
case "success": {
|
||||
const suggestedTitle = this.state.metadataRes.data.metadata.title;
|
||||
|
||||
// Clean up the title of any extra whitespace and replace with a space
|
||||
const suggestedTitle = this.state.metadataRes.data.metadata.title
|
||||
?.trim()
|
||||
.replace(/\s+/g, " ");
|
||||
return (
|
||||
suggestedTitle && (
|
||||
<button
|
||||
|
|
Loading…
Reference in a new issue