Skip to content

Commit ea773a7

Browse files
authored
fix: fix layout logic for refer friends components (#9224)
1 parent 4fa3146 commit ea773a7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/kit/src/views/ReferFriends/pages/InvitedByFriend/components/InvitedByFriendImage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ function InvitedByFriendImage() {
1515
const themeVariant = useThemeVariant();
1616
const { width: screenWidth } = useWindowDimensions();
1717

18-
const isDesktopImage = gtSm || platformEnv.isExtensionUiPopup;
18+
const isDesktopImage =
19+
!platformEnv.isNative && (gtSm || platformEnv.isExtensionUiPopup);
1920
const selectedImage = isDesktopImage ? desktopImg : mobileImg;
2021

2122
const imageWidth = useMemo(() => {
22-
if (gtSm) return 640;
23+
if (!platformEnv.isNative && gtSm) {
24+
return 640;
25+
}
2326
return screenWidth;
2427
}, [gtSm, screenWidth]);
2528

packages/kit/src/views/ReferFriends/pages/ReferAFriend/components/InviteCodeStepImage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export function InviteCodeStepImage({ step }: IInviteCodeStepImageProps) {
2828
const { gtSm } = useMedia();
2929
const themeVariant = useThemeVariant();
3030
const { width: screenWidth } = useWindowDimensions();
31-
const isDesktopImage = gtSm || platformEnv.isExtensionUiPopup;
31+
const isDesktopImage =
32+
!platformEnv.isNative && (gtSm || platformEnv.isExtensionUiPopup);
3233

3334
// Image mapping for steps and responsive versions
3435
const imageMap = {
@@ -47,7 +48,7 @@ export function InviteCodeStepImage({ step }: IInviteCodeStepImageProps) {
4748

4849
// Calculate image width based on platform and screen size
4950
const imageWidth = useMemo(() => {
50-
if (gtSm) return 640; // Desktop: fixed width
51+
if (!platformEnv.isNative && gtSm) return 640; // Desktop: fixed width
5152
return screenWidth; // Native / popup: screen width minus padding
5253
}, [gtSm, screenWidth]);
5354

0 commit comments

Comments
 (0)