@@ -6,6 +6,7 @@ import { gql } from "../../gql";
66import { CommentItem } from "../../lib/comment-item" ;
77import { Container } from "../../lib/container" ;
88import { FeedItem } from "../../lib/feed-item" ;
9+ import { Loading } from "../../lib/loading" ;
910import { MainSection } from "../../lib/main-section" ;
1011
1112const ProfileRouteQuery = gql ( /* GraphQL */ `
@@ -75,50 +76,55 @@ const Profile: NextPage = () => {
7576 </ Head >
7677
7778 < MainSection >
78- { profile == null ? null : (
79- < section className = "text-gray-600 body-font overflow-hidden" >
80- < div className = "container px-5 py-24 pt-10 mx-auto" >
81- < div >
82- < span className = "inline-block font-bold pr-2 w-20" > User</ span > { " " }
83- { profile . username }
84- </ div >
85- < div >
86- < span className = "inline-block font-bold pr-2 w-20" > Avatar</ span > { " " }
87- < img
88- className = "inline-block h-6 w-6 rounded-full"
89- src = { profile . avatarUrl }
90- />
91- </ div >
92- < div >
93- < span className = "inline-block font-bold pr-2 w-20" >
94- Website
95- </ span > { " " }
96- { profile . website }
97- </ div >
98-
99- < div className = "mb-10" >
100- < span className = "inline-block font-bold pr-2 w-20" > Bio</ span > { " " }
101- { profile . bio }
102- </ div >
103- < h1 className = "font-semibold text-xl tracking-tight mb-5" >
104- Latest Posts
105- </ h1 >
106- < div >
107- { profile . latestPosts ?. edges . map ( ( edge ) => (
108- < FeedItem post = { edge . node ! } key = { edge . cursor } />
79+ < div className = "w-full" >
80+ { profileQuery . fetching && < Loading /> }
81+ { profile == null ? null : (
82+ < section className = "text-gray-600 body-font overflow-hidden" >
83+ < div className = "container px-5 py-24 pt-10 mx-auto" >
84+ < h1 className = "font-semibold text-xl tracking-tight mb-5" >
85+ Profile
86+ </ h1 > { " " }
87+ < div >
88+ < span className = "inline-block font-bold pr-2 w-20" > User</ span > { " " }
89+ { profile . username }
90+ </ div >
91+ < div >
92+ < span className = "inline-block font-bold pr-2 w-20" >
93+ Avatar
94+ </ span > { " " }
95+ < img
96+ className = "inline-block h-6 w-6 rounded-full"
97+ src = { profile . avatarUrl }
98+ />
99+ </ div >
100+ < div >
101+ < span className = "inline-block font-bold pr-2 w-20" >
102+ Website
103+ </ span > { " " }
104+ { profile . website }
105+ </ div >
106+ < div className = "mb-10" >
107+ < span className = "inline-block font-bold pr-2 w-20" > Bio</ span > { " " }
108+ { profile . bio }
109+ </ div >
110+ < h1 className = "font-semibold text-xl tracking-tight mb-5" >
111+ Latest Posts
112+ </ h1 >
113+ < div >
114+ { profile . latestPosts ?. edges . map ( ( edge ) => (
115+ < FeedItem post = { edge . node ! } key = { edge . cursor } />
116+ ) ) }
117+ </ div >
118+ < h1 className = "font-semibold text-xl tracking-tight mb-5" >
119+ Latest Comments
120+ </ h1 >
121+ { profile . latestComments ?. edges . map ( ( edge ) => (
122+ < CommentItem comment = { edge . node ! } key = { edge . cursor } />
109123 ) ) }
110124 </ div >
111-
112- < h1 className = "font-semibold text-xl tracking-tight mb-5" >
113- Latest Comments
114- </ h1 >
115-
116- { profile . latestComments ?. edges . map ( ( edge ) => (
117- < CommentItem comment = { edge . node ! } key = { edge . cursor } />
118- ) ) }
119- </ div >
120- </ section >
121- ) }
125+ </ section >
126+ ) }
127+ </ div >
122128 </ MainSection >
123129 </ Container >
124130 ) ;
0 commit comments