Displays logged-in username and moved logout btn.
This commit is contained in:
		| @@ -1,5 +1,7 @@ | |||||||
| <template> | <template> | ||||||
|   <div class="chat-container"> |   <div class="chat-container"> | ||||||
|  |     <span class="logged-in-username" v-if="username">Logget inn som: <span class="username">{{ username }}</span> <button @click="removeUsername">Logg ut</button></span> | ||||||
|  |  | ||||||
|     <div class="history" ref="history" v-if="chatHistory.length > 0"> |     <div class="history" ref="history" v-if="chatHistory.length > 0"> | ||||||
|       <div class="opaque-skirt"></div> |       <div class="opaque-skirt"></div> | ||||||
|       <div v-if="hasMorePages" class="fetch-older-history"> |       <div v-if="hasMorePages" class="fetch-older-history"> | ||||||
| @@ -17,11 +19,12 @@ | |||||||
|         <span class="message">{{ history.message }}</span> |         <span class="message">{{ history.message }}</span> | ||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     <div v-if="username" class="input"> |  | ||||||
|  |     <div v-if="username" class="user-actions"> | ||||||
|       <input @keyup.enter="sendMessage" type="text" v-model="message" placeholder="Melding.." /> |       <input @keyup.enter="sendMessage" type="text" v-model="message" placeholder="Melding.." /> | ||||||
|       <button @click="sendMessage">Send</button> |       <button @click="sendMessage">Send</button> | ||||||
|       <button @click="removeUsername">Logg ut</button> |  | ||||||
|     </div> |     </div> | ||||||
|  |  | ||||||
|     <div v-else class="username-dialog"> |     <div v-else class="username-dialog"> | ||||||
|       <input |       <input | ||||||
|         type="text" |         type="text" | ||||||
| @@ -207,13 +210,34 @@ export default { | |||||||
|  |  | ||||||
| .chat-container { | .chat-container { | ||||||
|   position: relative; |   position: relative; | ||||||
|  |   transform: translate3d(0,0,0); | ||||||
| } | } | ||||||
|  |  | ||||||
| input { | input { | ||||||
|   width: 80%; |   width: 100%; | ||||||
|  |   height: 3.25rem; | ||||||
| } | } | ||||||
|  |  | ||||||
| .input { | .logged-in-username { | ||||||
|  |   position: absolute; | ||||||
|  |   top: 0.75rem; | ||||||
|  |   left: 1rem; | ||||||
|  |   color: $matte-text-color; | ||||||
|  |   width: calc(100% - 2rem); | ||||||
|  |  | ||||||
|  |   button { | ||||||
|  |     width: unset; | ||||||
|  |     padding: 5px 10px; | ||||||
|  |     position: absolute; | ||||||
|  |     right: 0rem; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .username { | ||||||
|  |     border-bottom: 2px solid $link-color; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .user-actions { | ||||||
|   display: flex; |   display: flex; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -223,6 +247,7 @@ input { | |||||||
|   overflow-y: scroll; |   overflow-y: scroll; | ||||||
|   position: relative; |   position: relative; | ||||||
|   max-height: 550px; |   max-height: 550px; | ||||||
|  |   margin-top: 2rem; | ||||||
|  |  | ||||||
|   &-message { |   &-message { | ||||||
|     display: flex; |     display: flex; | ||||||
| @@ -247,9 +272,9 @@ input { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   & .opaque-skirt { |   & .opaque-skirt { | ||||||
|     width: 100%; |     width: calc(100% - 2rem); | ||||||
|     position: absolute; |     position: fixed; | ||||||
|     height: 1rem; |     height: 2rem; | ||||||
|     z-index: 1; |     z-index: 1; | ||||||
|     background: linear-gradient( |     background: linear-gradient( | ||||||
|       to bottom, |       to bottom, | ||||||
| @@ -314,5 +339,9 @@ button { | |||||||
|   transition: transform 0.5s ease; |   transition: transform 0.5s ease; | ||||||
|   -webkit-font-smoothing: antialiased; |   -webkit-font-smoothing: antialiased; | ||||||
|   touch-action: manipulation; |   touch-action: manipulation; | ||||||
|  |  | ||||||
|  |   @include mobile { | ||||||
|  |     padding: 10px 10px; | ||||||
|  |   } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user