浏览代码

Display verification icon next to username

Carsten Porth 5 年之前
父节点
当前提交
34b3330f1a

+ 43 - 39
app/src/app/app.scss

@@ -13,47 +13,51 @@
 // for the .md, .ios, or .wp mode classes. The mode class is
 // automatically applied to the <body> element in the app.
 .hashtag {
-    color: color($colors, primary, base);
+  color: color($colors, primary, base);
+}
+
+.icon.icon-verified {
+  color: #1da1f2;
 }
 
 #sideNav {
-    .user-info {
-        .user-banner {
-            position: relative;
-            height: 140px;
-            margin-bottom: 20px;
-            .svg-triangle {
-                position: absolute;
-                bottom: 0;
-            }
-            .user-avatar {
-                position: absolute;
-                bottom: -10px;
-                left: 15px;
-                border-radius: 50%;
-            }
-        }
-        .user-info {
-            padding: 0 15px;
-            font-size: 15px;
-            font-weight: 500;
-            margin-bottom: 10px;
-            .handle {
-                color: #ababab;
-                font-weight: 300;
-                font-size: 11px;
-            }
-        }
-    }
-    .label-md {
-        margin-left: 8px;
-        display: flex;
-        align-items: center;
+  .user-info {
+    .user-banner {
+      position: relative;
+      height: 140px;
+      margin-bottom: 20px;
+      .svg-triangle {
+        position: absolute;
+        bottom: 0;
+      }
+      .user-avatar {
+        position: absolute;
+        bottom: -10px;
+        left: 15px;
+        border-radius: 50%;
+      }
     }
-    .item-inner {
-        padding-left: 8px;
-    }
-    .ion-icon {
-        line-height: 1;
+    .user-info {
+      padding: 0 15px;
+      font-size: 15px;
+      font-weight: 500;
+      margin-bottom: 10px;
+      .handle {
+        color: #ababab;
+        font-weight: 300;
+        font-size: 11px;
+      }
     }
-}
+  }
+  .label-md {
+    margin-left: 8px;
+    display: flex;
+    align-items: center;
+  }
+  .item-inner {
+    padding-left: 8px;
+  }
+  .ion-icon {
+    line-height: 1;
+  }
+}

+ 4 - 1
app/src/components/tweet-header/tweet-header.html

@@ -2,7 +2,10 @@
 <div class="header-container">
   <img src="{{ user.profile_image_url_https }}" alt="{{ user.name }}" class="avatar" (click)="showProfile(user.id_str)">
   <div class="username" (click)="showProfile(user.id)">
-    {{ user.name }}
+    <span>
+      {{ user.name }}
+      <ion-icon name="ios-checkmark-circle" *ngIf="user.verified" class="icon-verified"></ion-icon>
+    </span>
     <span class="twitter-handle">@{{user.screen_name}}</span>
   </div>
   <div class="timestamp">{{ tweetCreatedAt | diffForHumans }}</div>

+ 3 - 4
app/src/components/tweet-header/tweet-header.scss

@@ -5,7 +5,6 @@ tweet-header {
     align-items: center;
     margin-bottom: 4px;
   }
-
   .avatar {
     border-radius: 50%;
     width: 32px;
@@ -13,7 +12,6 @@ tweet-header {
     box-shadow: 0px 0px 4px 0px #777;
     margin: 4px 8px 4px 4px;
   }
-
   .username {
     display: flex;
     flex-direction: column;
@@ -25,15 +23,16 @@ tweet-header {
       font-weight: 400;
     }
   }
-
   .timestamp {
     color: #aaa;
     font-size: 10px;
     margin-left: auto;
   }
-
   .options {
     margin-left: 5px;
     color: #666;
   }
+  .icon.icon-verified {
+    font-size: 1em;
+  }
 }

+ 4 - 1
app/src/pages/profile/profile.html

@@ -6,7 +6,10 @@
 -->
 <ion-header>
   <ion-navbar>
-    <ion-title>{{ user.name }}</ion-title>
+    <ion-title>
+      {{ user.name }}
+      <ion-icon name="ios-checkmark-circle" *ngIf="user.verified" class="icon-verified"></ion-icon>
+    </ion-title>
   </ion-navbar>
 </ion-header>
 

+ 3 - 0
app/src/pages/profile/profile.scss

@@ -0,0 +1,3 @@
+ion-navbar .icon.icon-verified {
+  font-size: 2rem;
+}