@@ -97,20 +97,38 @@ function getPositions(
9797 isAnimDisabled : boolean | undefined ,
9898 isRevert : boolean | undefined
9999) {
100- const titleX = isAnimDisabled ? ( isRtl ? 520 : 15 ) : ( isRtl ? 510 : 5 ) ;
101- const titleY = isAnimDisabled ? 0 : - 10 ;
102- const textX = isRtl ? 225 : 20 ;
103- const dataX = isRtl ? 25 : 220 ;
104- const iconX = isRtl ? 235 : - 5 ;
105- const imageX = isAnimDisabled ? ( isRevert ? 412 : 122 ) : ( isRevert ? 417 : 127 ) ;
106- const imageY = isAnimDisabled ? 70 : 65 ;
107- const userX = isAnimDisabled ? ( isRevert ? 412 : 122 ) : ( isRevert ? 402 : 112 ) ;
108- const userY = isAnimDisabled ? 140 : 130 ;
109- const follX = isAnimDisabled ? ( isRevert ? 412 : 122 ) : ( isRevert ? 402 : 112 ) ;
110- const follY = isAnimDisabled ? 161 : 151 ;
111- const itemStatsX = isRevert ? ( isRtl ? 10 : 0 ) : 230 ;
100+ const configs = {
101+ animated : {
102+ title : { x : isRtl ? 510 : 5 , y : - 10 } ,
103+ image : { x : isRevert ? 417 : 127 , y : 65 } ,
104+ user : { x : isRevert ? 402 : 112 , y : 130 } ,
105+ foll : { x : isRevert ? 402 : 112 , y : 151 } ,
106+ } ,
107+ static : {
108+ title : { x : isRtl ? 520 : 15 , y : 0 } ,
109+ image : { x : isRevert ? 412 : 122 , y : 70 } ,
110+ user : { x : isRevert ? 412 : 122 , y : 140 } ,
111+ foll : { x : isRevert ? 412 : 122 , y : 161 } ,
112+ } ,
113+ } ;
114+
115+ const mode = isAnimDisabled ? "static" : "animated" ;
116+ const config = configs [ mode ] ;
112117
113- return { titleX, titleY, textX, dataX, iconX, imageX, imageY, userX, userY, follX, follY, itemStatsX } ;
118+ return {
119+ titleX : config . title . x ,
120+ titleY : config . title . y ,
121+ textX : isRtl ? 225 : 20 ,
122+ dataX : isRtl ? 25 : 220 ,
123+ iconX : isRtl ? 235 : - 5 ,
124+ imageX : config . image . x ,
125+ imageY : config . image . y ,
126+ userX : config . user . x ,
127+ userY : config . user . y ,
128+ follX : config . foll . x ,
129+ follY : config . foll . y ,
130+ itemStatsX : isRevert ? ( isRtl ? 10 : 0 ) : 230 ,
131+ } ;
114132}
115133
116134/**
0 commit comments