Skip to content

Commit 6f412e6

Browse files
committed
Add loading profile skeleton
1 parent 9cfe6b0 commit 6f412e6

3 files changed

Lines changed: 60 additions & 7 deletions

File tree

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId "com.compassconnections.app"
1212
minSdkVersion rootProject.ext.minSdkVersion
1313
targetSdkVersion rootProject.ext.targetSdkVersion
14-
versionCode 113
15-
versionName "1.27.0"
14+
versionCode 114
15+
versionName "1.28.0"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
aaptOptions {
1818
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

web/components/profile/profile-info.tsx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,60 @@ export function ProfileInfo(props: {
207207
)
208208
}
209209

210+
export function ProfileInfoSkeleton() {
211+
return (
212+
<>
213+
<div
214+
className="bg-canvas-50 border-canvas-300 mb-6 flex items-center border-b px-4 sm:px-9 py-4"
215+
style={{
216+
borderBottomWidth: '1px',
217+
gap: '10px',
218+
}}
219+
>
220+
<div className="flex w-full items-center gap-2">
221+
<BackButton />
222+
</div>
223+
</div>
224+
225+
<div className="mx-auto w-full px-4 sm:px-8 pb-6 pt-0 animate-pulse">
226+
<Row className="gap-6 flex-wrap">
227+
<div className="bg-canvas-200 h-[108px] w-[108px] flex-none rounded-2xl" />
228+
<Col className="flex-1 gap-3 py-1 min-w-[160px]">
229+
<div className="bg-canvas-200 h-8 w-2/3 max-w-[240px] rounded" />
230+
<div className="bg-canvas-200 h-4 w-1/2 max-w-[180px] rounded" />
231+
<div className="bg-canvas-200 h-4 w-2/5 max-w-[140px] rounded" />
232+
</Col>
233+
</Row>
234+
235+
<Row className="gap-2 flex-wrap py-3 mt-2 max-w-full sm:max-w-[500px]">
236+
<div className="bg-canvas-200 h-7 w-16 rounded-full" />
237+
<div className="bg-canvas-200 h-7 w-20 rounded-full" />
238+
<div className="bg-canvas-200 h-7 w-14 rounded-full" />
239+
<div className="bg-canvas-200 h-7 w-24 rounded-full" />
240+
</Row>
241+
242+
<div
243+
className="bg-canvas-50 border-canvas-300 border mt-6"
244+
style={{borderRadius: '14px', padding: '22px 24px'}}
245+
>
246+
<div className="bg-canvas-200 h-6 w-24 rounded mb-5" />
247+
<Col className="gap-4">
248+
{[...Array(6)].map((_, i) => (
249+
<Row key={i} className="items-center gap-2.5">
250+
<div className="bg-canvas-200 h-8 w-8 flex-none rounded-lg" />
251+
<Col className="flex-1 gap-1.5">
252+
<div className="bg-canvas-200 h-3 w-20 rounded" />
253+
<div className="bg-canvas-200 h-4 w-3/5 rounded" />
254+
</Col>
255+
</Row>
256+
))}
257+
</Col>
258+
</div>
259+
</div>
260+
</>
261+
)
262+
}
263+
210264
function ProfileCard(props: {title?: ReactNode; children: ReactNode; className?: string}) {
211265
const {title, children, className} = props
212266
// Check if children is null or undefined

web/pages/[username]/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import {useRouter} from 'next/router'
1111
import {useEffect, useMemo, useState} from 'react'
1212
import {Col} from 'web/components/layout/col'
1313
import {PageBase} from 'web/components/page-base'
14-
import {ProfileInfo} from 'web/components/profile/profile-info'
14+
import {ProfileInfo, ProfileInfoSkeleton} from 'web/components/profile/profile-info'
1515
import {SEO} from 'web/components/SEO'
16-
import {CompassLoadingIndicator} from 'web/components/widgets/loading-indicator'
1716
import {useProfileByUser} from 'web/hooks/use-profile'
1817
import {useSaveReferral} from 'web/hooks/use-save-referral'
1918
import {useTracking} from 'web/hooks/use-tracking'
@@ -219,8 +218,8 @@ export default function UserPage(props: UserPageProps) {
219218

220219
if (loading) {
221220
return (
222-
<PageBase trackPageView={'user page'}>
223-
<CompassLoadingIndicator />
221+
<PageBase trackPageView={'user page'} className={'relative !px-0 sm:pt-0 !mt-0 col-span-10'}>
222+
<ProfileInfoSkeleton />
224223
</PageBase>
225224
)
226225
}
@@ -324,7 +323,7 @@ function UserPageInner(props: ActiveUserPageProps) {
324323
fromSignup={fromSignup}
325324
/>
326325
) : (
327-
<CompassLoadingIndicator />
326+
<ProfileInfoSkeleton />
328327
)}
329328
</Col>
330329
)}

0 commit comments

Comments
 (0)