11<template >
22 <v-responsive >
33 <Loading v-if =" this.userData === null" loadingComponentChoice =" Dots" />
4+ <div v-else-if =" this.userData.notFound === true" class =" flex-row" >
5+ <div class =" card padding-3" >
6+ <h2 >404: User Not Found</h2 >
7+ </div >
8+ </div >
49 <div v-else class =" flex-row" >
510 <div class =" card" >
611 <div class =" flex-column no-wrap" >
2126 <h2 >{{ this.userData.name }}</h2 >
2227 <p class =" margin-bottom" >{{ this.userData.bio }}</p >
2328 <ul class =" margin-bottom" >
24- <li ><strong >Followers </strong > : {{ this.userData.followers }}</li >
25- <li ><strong >Following </strong > : {{ this.userData.following }}</li >
2629 <li >
27- <strong >Repositories </strong > :
30+ <strong >Followers:  ; </strong > {{ this.userData.followers }}
31+ </li >
32+ <li >
33+ <strong >Following:  ; </strong > {{ this.userData.following }}
34+ </li >
35+ <li >
36+ <strong >Repositories:  ; </strong >
2837 {{ this.userData.public_repos }}
2938 </li >
3039 </ul >
3140 <ul class =" second-desc margin-bottom" >
3241 <li v-if =" this.userData.location" >
33- <strong >Location</strong > : {{ this.userData.location }}
42+ <strong >Location: & nbsp ; </strong > {{ this.userData.location }}
3443 </li >
3544 </ul >
3645 <ul class =" margin-bottom" >
3746 <li v-if =" this.userData.created_at" >
38- <strong >Created</strong > : {{ this.userData.created_at }}
47+ <strong >Created: & nbsp ; </strong > {{ this.userData.created_at }}
3948 </li >
4049 </ul >
4150 <Loading
5261 >
5362 </v-chip-group >
5463 </div >
55- <div class =" external-buttons-column margin-right-auto " >
64+ <div class =" external-buttons-column" >
5665 <v-btn
5766 variant =" plain"
5867 icon =" mdi-github"
@@ -114,6 +123,10 @@ export default {
114123 type: Number ,
115124 required: true ,
116125 },
126+ exampleUsernames: {
127+ type: Set ,
128+ required: true ,
129+ },
117130 },
118131 data : function () {
119132 return { userData: null , userRepos: null , pieChartModalOpen: false };
@@ -131,7 +144,23 @@ export default {
131144 .then ((response ) => response .json ())
132145 .then ((data ) => {
133146 this .userData = data;
134- console .log (this .userData );
147+
148+ if (
149+ this .userData .message === " Not Found" ||
150+ this .username === " " ||
151+ this .username === null
152+ ) {
153+ this .userData = {
154+ notFound: true ,
155+ };
156+ }
157+
158+ this .exampleUsernames .add (this .username .toLowerCase ());
159+ if (this .exampleUsernames .size > 20 ) {
160+ this .exampleUsernames .delete (
161+ this .exampleUsernames .values ().next ().value
162+ );
163+ }
135164 moment .defaultFormat = " DD.MM.YYYY, HH:mm" ;
136165
137166 this .userData .created_at = moment (this .userData .created_at ).format (
@@ -201,25 +230,31 @@ export default {
201230.card {
202231 max-width : min (85vw , 800px );
203232 background-color : gainsboro ;
204- color : #000 ;
233+ color : black ;
205234 border-radius : 30px ;
206235 box-shadow : 0 5px 10px rgba (154 , 160 , 185 , 0.05 ),
207236 0 15px 40px rgba (0 , 0 , 0 , 0.1 );
208237 display : flex ;
209238 padding : 3rem ;
239+ padding-right : 0 ;
210240 font-size : 16px ;
211241 margin : 20px auto ;
212242}
213243
244+ .padding-3 {
245+ padding : 3rem ;
246+ }
247+
214248.avatar {
215- border-radius : 20 % ;
216- border : 10 px solid #2a2a72 ;
249+ border-radius : 30 % ;
250+ border : 6 px solid gray ;
217251 height : 150px ;
218252 width : 150px ;
253+ margin-bottom : 5px ;
219254}
220255
221256.user-info {
222- color : #000 ;
257+ /* color: #000; */
223258 margin-left : 2rem ;
224259}
225260
@@ -280,15 +315,16 @@ export default {
280315.external-buttons-column {
281316 position : relative ;
282317 top : -40px ;
283- right : -115 px ;
318+ right : -50 px ;
284319 display : flex ;
285320 flex-direction : column ;
286321 justify-content : flex-start ;
287- padding : 0px 15px ;
322+ /* padding: 0px 15px; */
288323 color : white ;
324+ margin : 0 ;
289325}
290326.card-external-buttons {
291- margin-right : auto ;
327+ margin : 0 ;
292328 margin-bottom : 10px ;
293329}
294330
@@ -313,6 +349,7 @@ export default {
313349 flex-direction : column ;
314350 align-items : center ;
315351 padding : 1rem ;
352+ max-width : 90vw ;
316353 }
317354
318355 ul .second-desc {
@@ -325,16 +362,21 @@ export default {
325362 .external-buttons-column {
326363 flex-direction : row ;
327364 color : black ;
328- margin-top : 30 px ;
365+ margin-right : auto ;
329366 display : inline-block ;
330367 top : 0 ;
331368 right : 0 ;
332369 }
370+ .user-info {
371+ /* color: #000; */
372+ margin : auto ;
373+ }
333374}
334375
335376@media (max-width : 450px ) {
336377 .user-info ul {
337- display : none ;
378+ /* display: none; */
379+ flex-wrap : wrap ;
338380 }
339381}
340382 </style >
0 commit comments