mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 12:21:13 +00:00
Merge branch 'federate-page' of https://github.com/LemmyNet/lemmy-ui into federate-page
This commit is contained in:
commit
324dc49f26
3 changed files with 35 additions and 30 deletions
|
@ -32,7 +32,7 @@ export class EmojiPicker extends Component<EmojiPickerProps, EmojiPickerState> {
|
||||||
return (
|
return (
|
||||||
<span className="emoji-picker">
|
<span className="emoji-picker">
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm text-muted"
|
className="btn btn-sm btn-link rounded-0 text-muted"
|
||||||
data-tippy-content={I18NextService.i18n.t("emoji")}
|
data-tippy-content={I18NextService.i18n.t("emoji")}
|
||||||
aria-label={I18NextService.i18n.t("emoji")}
|
aria-label={I18NextService.i18n.t("emoji")}
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
|
|
|
@ -170,34 +170,39 @@ export class MarkdownTextArea extends Component<
|
||||||
<EmojiPicker
|
<EmojiPicker
|
||||||
onEmojiClick={e => this.handleEmoji(this, e)}
|
onEmojiClick={e => this.handleEmoji(this, e)}
|
||||||
></EmojiPicker>
|
></EmojiPicker>
|
||||||
<form className="btn btn-sm text-muted fw-bold">
|
<label
|
||||||
<label
|
htmlFor={`file-upload-${this.id}`}
|
||||||
htmlFor={`file-upload-${this.id}`}
|
className={classNames("mb-0", {
|
||||||
// TODO: Fix this linting violation
|
pointer: UserService.Instance.myUserInfo,
|
||||||
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
})}
|
||||||
tabIndex={0}
|
data-tippy-content={I18NextService.i18n.t("upload_image")}
|
||||||
className={`mb-0 ${
|
>
|
||||||
UserService.Instance.myUserInfo && "pointer"
|
{this.state.imageUploadStatus ? (
|
||||||
}`}
|
<Spinner />
|
||||||
data-tippy-content={I18NextService.i18n.t("upload_image")}
|
) : (
|
||||||
>
|
<button
|
||||||
{this.state.imageUploadStatus ? (
|
type="button"
|
||||||
<Spinner />
|
className="btn btn-sm btn-link rounded-0 text-muted mb-0"
|
||||||
) : (
|
onClick={() => {
|
||||||
|
document
|
||||||
|
.getElementById(`file-upload-${this.id}`)
|
||||||
|
?.click();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Icon icon="image" classes="icon-inline" />
|
<Icon icon="image" classes="icon-inline" />
|
||||||
)}
|
</button>
|
||||||
</label>
|
)}
|
||||||
<input
|
</label>
|
||||||
id={`file-upload-${this.id}`}
|
<input
|
||||||
type="file"
|
id={`file-upload-${this.id}`}
|
||||||
accept="image/*,video/*"
|
type="file"
|
||||||
name="file"
|
accept="image/*,video/*"
|
||||||
className="d-none"
|
name="file"
|
||||||
multiple
|
className="d-none"
|
||||||
disabled={!UserService.Instance.myUserInfo}
|
multiple
|
||||||
onChange={linkEvent(this, this.handleImageUpload)}
|
disabled={!UserService.Instance.myUserInfo}
|
||||||
/>
|
onChange={linkEvent(this, this.handleImageUpload)}
|
||||||
</form>
|
/>
|
||||||
{this.getFormatButton("header", this.handleInsertHeader)}
|
{this.getFormatButton("header", this.handleInsertHeader)}
|
||||||
{this.getFormatButton(
|
{this.getFormatButton(
|
||||||
"strikethrough",
|
"strikethrough",
|
||||||
|
@ -348,7 +353,7 @@ export class MarkdownTextArea extends Component<
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm text-muted"
|
className="btn btn-sm btn-link rounded-0 text-muted"
|
||||||
data-tippy-content={I18NextService.i18n.t(type)}
|
data-tippy-content={I18NextService.i18n.t(type)}
|
||||||
aria-label={I18NextService.i18n.t(type)}
|
aria-label={I18NextService.i18n.t(type)}
|
||||||
onClick={linkEvent(this, handleClick)}
|
onClick={linkEvent(this, handleClick)}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export default function isAuthPath(pathname: string) {
|
export default function isAuthPath(pathname: string) {
|
||||||
return /^\/create_.*|inbox|settings|admin|reports|registration_applications|federate/g.test(
|
return /^\/(create_.*?|inbox|settings|admin|reports|registration_applications|federate)\b/g.test(
|
||||||
pathname
|
pathname
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue