]> Untitled Git - lemmy.git/commitdiff
Removing placeholder image for avatar upload.
authorDessalines <tyhou13@gmx.com>
Tue, 14 Jan 2020 21:58:14 +0000 (16:58 -0500)
committerDessalines <tyhou13@gmx.com>
Tue, 14 Jan 2020 21:58:14 +0000 (16:58 -0500)
- Fixes #419

ui/src/components/user.tsx
ui/src/translations/en.ts

index 30ee3dcf1e26251becf5950601e7f29789c4ed2a..c95b18bb148776aa474db93a35d978bc5c0fb5ab 100644 (file)
@@ -130,14 +130,7 @@ export class User extends Component<any, UserState> {
     this.state.username = this.props.match.params.username;
 
     this.subscription = WebSocketService.Instance.subject
-      .pipe(
-        retryWhen(errors =>
-          errors.pipe(
-            delay(3000),
-            take(10)
-          )
-        )
-      )
+      .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
       .subscribe(
         msg => this.parseMessage(msg),
         err => console.error(err),
@@ -449,16 +442,18 @@ export class User extends Component<any, UserState> {
                     htmlFor="file-upload"
                     class="pointer ml-4 text-muted small font-weight-bold"
                   >
-                    <img
-                      height="80"
-                      width="80"
-                      src={
-                        this.state.userSettingsForm.avatar
-                          ? this.state.userSettingsForm.avatar
-                          : 'https://via.placeholder.com/300/000?text=Avatar'
-                      }
-                      class="rounded-circle"
-                    />
+                    {!this.state.userSettingsForm.avatar ? (
+                      <span class="btn btn-sm btn-secondary">
+                        <T i18nKey="upload_avatar">#</T>
+                      </span>
+                    ) : (
+                      <img
+                        height="80"
+                        width="80"
+                        src={this.state.userSettingsForm.avatar}
+                        class="rounded-circle"
+                      />
+                    )}
                   </label>
                   <input
                     id="file-upload"
index bd7e39ccd85ba9af65f8396fa94f879b17399798..f2184024f5d5bec2571054e61c2dabddbb36d409 100644 (file)
@@ -29,6 +29,7 @@ export const en = {
     preview: 'Preview',
     upload_image: 'upload image',
     avatar: 'Avatar',
+    upload_avatar: 'Upload Avatar',
     show_avatars: 'Show Avatars',
     formatting_help: 'formatting help',
     view_source: 'view source',