Skip to content

Commit 060c3c4

Browse files
chore: improved shimmer + fixed reown logo in qr code landscape
1 parent ef110e9 commit 060c3c4

File tree

4 files changed

+32
-15
lines changed

4 files changed

+32
-15
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Linking, type StyleProp, type ViewStyle } from 'react-native';
2+
import { ConstantsUtil } from '@reown/appkit-common-react-native';
3+
import { FlexView, Icon, Pressable, Text } from '@reown/appkit-ui-react-native';
4+
5+
interface Props {
6+
style?: StyleProp<ViewStyle>;
7+
}
8+
9+
export function ReownButton({ style }: Props) {
10+
return (
11+
<Pressable onPress={() => Linking.openURL(ConstantsUtil.REOWN_URL)} style={style}>
12+
<FlexView alignItems="center" justifyContent="center" flexDirection="row" columnGap="2xs">
13+
<Text variant="small-500" color="fg-100">
14+
UX by
15+
</Text>
16+
<Icon name="reown" color="fg-150" width={100} height={30} />
17+
</FlexView>
18+
</Pressable>
19+
);
20+
}

packages/appkit/src/partials/w3m-connecting-qrcode/index.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import {
66
OptionsController,
77
SnackController
88
} from '@reown/appkit-core-react-native';
9-
import { ConstantsUtil } from '@reown/appkit-common-react-native';
10-
import { FlexView, Link, QrCode, Text, Spacing, Icon } from '@reown/appkit-ui-react-native';
9+
import { FlexView, Link, QrCode, Text, Spacing } from '@reown/appkit-ui-react-native';
1110
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
1211
import styles from './styles';
13-
import { Linking, Pressable } from 'react-native';
12+
import { ReownButton } from './components/ReownButton';
1413

1514
export function ConnectingQrCode() {
1615
const { wcUri } = useSnapshot(WcController.state);
@@ -49,10 +48,11 @@ export function ConnectingQrCode() {
4948
alignItems="center"
5049
justifyContent="center"
5150
flexDirection={isPortrait ? 'column' : 'row'}
52-
padding={['xl', 'xl', '2xl', 'xl']}
51+
padding="xl"
5352
>
5453
<QrCode size={qrSize} uri={wcUri} testID="qr-code" />
55-
<FlexView alignItems="center" margin={['m', 'm', '3xl', 'm']}>
54+
{!isPortrait ? <ReownButton /> : null}
55+
<FlexView alignItems="center" margin={['m', 'm', '0', 'm']}>
5656
<Text variant="paragraph-500">Scan this QR code with your phone</Text>
5757
{showCopy ? (
5858
<Link
@@ -65,15 +65,8 @@ export function ConnectingQrCode() {
6565
Copy link
6666
</Link>
6767
) : null}
68+
<ReownButton style={styles.reownButton} />
6869
</FlexView>
69-
<Pressable onPress={() => Linking.openURL(ConstantsUtil.REOWN_URL)}>
70-
<FlexView alignItems="center" justifyContent="center" flexDirection="row" columnGap="2xs">
71-
<Text variant="small-500" color="fg-100">
72-
UX by
73-
</Text>
74-
<Icon name="reown" color="fg-150" width={100} height={30} />
75-
</FlexView>
76-
</Pressable>
7770
</FlexView>
7871
);
7972
}

packages/appkit/src/partials/w3m-connecting-qrcode/styles.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ import { StyleSheet } from 'react-native';
44
export default StyleSheet.create({
55
copyButton: {
66
marginTop: Spacing.m
7+
},
8+
reownButton: {
9+
marginTop: Spacing['2xl']
710
}
811
});

packages/ui/src/components/wui-shimmer/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ export const Shimmer = ({
6969

7070
const onLayout = (event: any) => {
7171
const { width: w, height: h } = event.nativeEvent.layout;
72-
if (!measuredWidth) {
72+
// Update measurements whenever they change to adapt to dynamic layout/orientation
73+
if (measuredWidth == null || Math.abs(w - measuredWidth) > 0.5) {
7374
setMeasuredWidth(w);
7475
}
75-
if (!measuredHeight) {
76+
if (measuredHeight == null || Math.abs(h - measuredHeight) > 0.5) {
7677
setMeasuredHeight(h);
7778
}
7879
};

0 commit comments

Comments
 (0)