@@ -2,13 +2,14 @@ import {memo, useCallback, useEffect, useRef, useState} from 'react';
2
2
3
3
import APAvatar from '@src/components/global/APAvatar' ;
4
4
import DotsPattern from './DotsPattern' ;
5
+ import ProfileCardShadow from '@assets/images/profile-card-shadow.png' ;
6
+ import ProfileCardShadowSquare from '@assets/images/profile-card-shadow-square.png' ;
5
7
import html2canvas from 'html2canvas-objectfit-fix' ;
6
8
import { Account } from '@src/api/activitypub' ;
7
9
import { Button , H2 , LoadingIndicator , LucideIcon , Skeleton , ToggleGroup , ToggleGroupItem , Tooltip , TooltipContent , TooltipProvider , TooltipTrigger } from '@tryghost/shade' ;
8
10
import { imageUrlToDataUrl } from '@src/utils/image' ;
9
11
import { toast } from 'sonner' ;
10
12
import { useBrowseSite } from '@tryghost/admin-x-framework/api/site' ;
11
- import { useFeatureFlags } from '@src/lib/feature-flags' ;
12
13
13
14
type ProfileProps = {
14
15
account ?: Account
@@ -77,8 +78,8 @@ const ProfileCard: React.FC<ProfileCardProps> = memo(({
77
78
78
79
const cardBackgroundColor = getBackgroundColor ( ) ;
79
80
const textColor = getTextColor ( ) ;
80
- const margin = isScreenshot ? 'm-4 ' : 'm-16' ;
81
- const borderClass = isScreenshot ? backgroundColor === 'light' ? 'border border-gray-200' : '' : 'shadow-xl' ;
81
+ const margin = isScreenshot ? 'm-12 ' : 'm-16' ;
82
+ const borderClass = isScreenshot ? '' : 'shadow-xl' ;
82
83
83
84
const cardWidth = format === 'square' ? 'w-[422px]' : 'w-[316px]' ;
84
85
const cardHeight = 'h-[422px]' ;
@@ -138,7 +139,6 @@ const ProfileCard: React.FC<ProfileCardProps> = memo(({
138
139
ProfileCard . displayName = 'ProfileCard' ;
139
140
140
141
const Profile : React . FC < ProfileProps > = ( { account, isLoading} ) => {
141
- const { isEnabled} = useFeatureFlags ( ) ;
142
142
const { data : siteData } = useBrowseSite ( ) ;
143
143
const accentColor = siteData ?. site ?. accent_color ;
144
144
const coverImage = siteData ?. site ?. cover_image ;
@@ -270,27 +270,6 @@ const Profile: React.FC<ProfileProps> = ({account, isLoading}) => {
270
270
}
271
271
} ;
272
272
273
- if ( ! isEnabled ( 'share' ) ) {
274
- return (
275
- < div className = 'flex flex-col items-center' >
276
- < APAvatar
277
- author = {
278
- {
279
- icon : {
280
- url : account ?. avatarUrl || ''
281
- } ,
282
- name : account ?. name || '' ,
283
- handle : account ?. handle
284
- }
285
- }
286
- size = 'lg'
287
- />
288
- < H2 className = 'mb-0.5 mt-4' > { ! isLoading ? account ?. name : < Skeleton className = 'w-32' /> } </ H2 >
289
- < span className = 'text-[1.5rem] text-gray-700' > { ! isLoading ? account ?. handle : < Skeleton className = 'w-full max-w-56' /> } </ span >
290
- </ div >
291
- ) ;
292
- }
293
-
294
273
return (
295
274
< TooltipProvider delayDuration = { 0 } >
296
275
< div className = 'flex flex-col gap-5' >
@@ -395,7 +374,7 @@ const Profile: React.FC<ProfileProps> = ({account, isLoading}) => {
395
374
ref = { profileCardRef }
396
375
className = 'fixed left-[-9999px] top-0 z-[-1] flex w-fit justify-center overflow-hidden rounded-2xl bg-gray-50'
397
376
style = { {
398
- width : cardFormat === 'square' ? '454px ' : '348px ' ,
377
+ width : cardFormat === 'square' ? '518px ' : '412px ' ,
399
378
fontFamily : 'system-ui'
400
379
} }
401
380
>
@@ -416,13 +395,12 @@ const Profile: React.FC<ProfileProps> = ({account, isLoading}) => {
416
395
< DotsPattern className = { `absolute left-[-62.5px] top-[-44px] h-[600px] w-[598px] ${ backgroundColor === 'dark' && 'z-10' } ` } style = { { color : getDotsPatternColor ( ) } } />
417
396
}
418
397
< div
419
- className = 'absolute left-0 top-0'
398
+ className = 'absolute left-0 top-0 size-full '
420
399
style = { {
421
- height : '456px' ,
422
- width : '456px' ,
423
400
background : getGradient ( )
424
401
} }
425
402
/>
403
+ < img className = 'absolute left-1/2 top-12 mt-0.5 max-w-none -translate-x-1/2' src = { cardFormat === 'square' ? ProfileCardShadowSquare : ProfileCardShadow } style = { { width : cardFormat === 'square' ? '572px' : '466px' } } />
426
404
</ div >
427
405
</ div >
428
406
</ TooltipProvider >
0 commit comments