Skip to content

Commit

Permalink
fix: regression issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sakul-budhathoki committed Dec 29, 2023
1 parent 8ef93bc commit b454516
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
1 change: 1 addition & 0 deletions packages/components/NetworkSelector/NetworkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const NetworkSelector: React.FC<{
forceNetworkId={forceNetworkId}
forceNetworkKind={forceNetworkKind}
forceNetworkFeatures={forceNetworkFeatures}
onSelect={() => setDropdownState(false)}
/>
)}
</View>
Expand Down
10 changes: 9 additions & 1 deletion packages/components/NetworkSelector/NetworkSelectorMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ export const NetworkSelectorMenu: FC<{
forceNetworkKind?: NetworkKind;
forceNetworkFeatures?: NetworkFeature[];
style?: StyleProp<ViewStyle>;
}> = ({ forceNetworkId, forceNetworkKind, forceNetworkFeatures, style }) => {
onSelect: () => void;
}> = ({
forceNetworkId,
forceNetworkKind,
forceNetworkFeatures,
style,
onSelect,
}) => {
const { resetMediaPlayer } = useMediaPlayer();
const dispatch = useAppDispatch();
const { wallets } = useWallets();
Expand All @@ -39,6 +46,7 @@ export const NetworkSelectorMenu: FC<{
const isMobile = useIsMobile();

const onPressNetwork = (networkId: string) => {
onSelect();
let walletProvider: WalletProvider | null = null;

const network = getNetwork(networkId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const NetworkSelectorMobile: React.FC<{
forceNetworkId={forceNetworkId}
forceNetworkKind={forceNetworkKind}
forceNetworkFeatures={forceNetworkFeatures}
onSelect={() => setDropdownState(false)}
/>
)}
</View>
Expand Down
43 changes: 23 additions & 20 deletions packages/components/TopMenu/TopMenuMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,31 @@ export const TopMenuMobile: FC = () => {
const selectedWallet = useSelectedWallet();

return (
<View ref={dropdownRef} collapsable={false}>
<TouchableOpacity onPress={() => setDropdownState(false)}>
<View>
<TouchableOpacity onPress={() => setDropdownState(true)}>
<UserAvatarWithFrame size="XXS" userId={selectedWallet?.userId} />
</TouchableOpacity>

<TopMenuBox
style={[
{
backgroundColor: neutral00,
position: "absolute",
top: 48,
right: -60,
},
!isDropdownOpen && { display: "none" },
]}
mainContainerStyle={{
borderTopWidth: 0,
borderRightWidth: 0,
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
}}
/>
<View ref={dropdownRef} collapsable={false}>
<TopMenuBox
ref={dropdownRef}

Check failure on line 22 in packages/components/TopMenu/TopMenuMobile.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Type '{ ref: RefObject<View>; collapsable: boolean; style: (false | { backgroundColor: string; position: "absolute"; top: number; right: number; } | { display: "none"; })[]; mainContainerStyle: { ...; }; }' is not assignable to type 'IntrinsicAttributes & { style?: StyleProp<ViewStyle>; mainContainerStyle?: StyleProp<ViewStyle>; }'.
collapsable={false}
style={[
{
backgroundColor: neutral00,
position: "absolute",
top: 48,
right: -60,
},
!isDropdownOpen && { display: "none" },
]}
mainContainerStyle={{
borderTopWidth: 0,
borderRightWidth: 0,
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
}}
/>
</View>
</View>
);
};
4 changes: 2 additions & 2 deletions packages/components/toasts/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const Toast: React.FC<{
<TouchableOpacity
onPress={onPress}
style={{
maxWidth: width,
width,
maxWidth: Math.min(TOAST_WIDTH, width),
width: Math.min(TOAST_WIDTH, width),
height: "auto",
position: "absolute",
top: insets.top + layout.spacing_x1,
Expand Down

0 comments on commit b454516

Please sign in to comment.