summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-form.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-10-17 20:19:20 -0700
committerDessalines <tyhou13@gmx.com>2019-10-17 20:19:20 -0700
commit7004451db4efb8a5b76b11772a14a45750a53625 (patch)
treec0b32ee1906bccc62905a5bfb649dd9aa108bd0a /ui/src/components/post-form.tsx
parent4e3998c64cbcee92ba34fdb5572d73631aea2dab (diff)
Don't allow image uploads for non-logged-in users.
- Fixes #297
Diffstat (limited to 'ui/src/components/post-form.tsx')
-rw-r--r--ui/src/components/post-form.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx
index b59d07d6..09b9606e 100644
--- a/ui/src/components/post-form.tsx
+++ b/ui/src/components/post-form.tsx
@@ -112,8 +112,8 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
<div class="mt-1 text-muted small font-weight-bold pointer" onClick={linkEvent(this, this.copySuggestedTitle)}><T i18nKey="copy_suggested_title" interpolation={{title: this.state.suggestedTitle}}>#</T></div>
}
<form>
- <label htmlFor="file-upload" class="pointer d-inline-block mr-2 float-right text-muted small font-weight-bold"><T i18nKey="upload_image">#</T></label>
- <input id="file-upload" type="file" accept="image/*,video/*" name="file" class="d-none" onChange={linkEvent(this, this.handleImageUpload)} />
+ <label htmlFor="file-upload" className={`${UserService.Instance.user && 'pointer'} d-inline-block mr-2 float-right text-muted small font-weight-bold`}><T i18nKey="upload_image">#</T></label>
+ <input id="file-upload" type="file" accept="image/*,video/*" name="file" class="d-none" disabled={!UserService.Instance.user} onChange={linkEvent(this, this.handleImageUpload)} />
</form>
{this.state.imageLoading &&
<svg class="icon icon-spinner spin"><use xlinkHref="#icon-spinner"></use></svg>