Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet): disable multi wallets #1149

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/screens/Mini/Profile/ProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export const ProfileScreen: ScreenFC<"MiniProfile"> = ({ navigation }) => {
});
};

// disable multiple wallet creation, remove to re enable multiple
omniwired marked this conversation as resolved.
Show resolved Hide resolved
if (wallets.length !== 0) {
delete profileScreens[0];
}

return (
<BlurScreenContainer
noScrollView
Expand Down
46 changes: 31 additions & 15 deletions packages/screens/Wallet/Screens/NativeWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import { BrandText } from "@/components/BrandText";
import { SVGorImageIcon } from "@/components/SVG/SVGorImageIcon";
import { CustomButton } from "@/components/buttons/CustomButton";
import { SpacerColumn } from "@/components/spacer";
import { useAppMode } from "@/hooks/useAppMode";
import { useSelectedNativeWallet } from "@/hooks/wallet/useSelectedNativeWallet";
import { ScreenFC } from "@/utils/navigation";
import { fontSemibold12 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";

const NativeWallet: ScreenFC<"NativeWallet"> = () => {
const nativeWallet = useSelectedNativeWallet();
const [appMode] = useAppMode();

return (
<WalletContainer>
Expand All @@ -43,33 +45,47 @@ const NativeWallet: ScreenFC<"NativeWallet"> = () => {
alignItems: "center",
}}
>
<CustomButton
title="Create Wallet"
onPress={(_, navigation) => {
navigation.navigate("CreateWallet");
}}
/>
{
// disable multiple wallet creation, remove to re enable multiple
!nativeWallet && (
<CustomButton
title="Create Wallet"
onPress={(_, navigation) => {
navigation.navigate("CreateWallet");
}}
/>
)
}
{nativeWallet && (
<CustomButton
title="Continue"
style={{
marginVertical: layout.spacing_x2,
}}
onPress={(_, navigation) => {
navigation.navigate("MiniTabs", { screen: "MiniChats" });
if (appMode === "mini") {
omniwired marked this conversation as resolved.
Show resolved Hide resolved
navigation.navigate("MiniWallets");
} else {
navigation.navigate("WalletManager");
}
}}
/>
)}
<SpacerColumn size={1.5} />
<View style={{ flexDirection: "row", gap: layout.spacing_x1_5 }}>
<CustomButton
onPress={(_, navigation) => {
navigation.navigate("ImportWallet");
}}
title="Import Wallet"
style={{ flex: 1 }}
type="outline"
/>
{
// disable multiple wallet creation, remove to re enable multiple
!nativeWallet && (
<CustomButton
onPress={(_, navigation) => {
navigation.navigate("ImportWallet");
}}
title="Import Wallet"
style={{ flex: 1 }}
type="outline"
/>
)
}
{/* Hiding connect ledger option until it is ready for implementation */}
{/* <CustomButton
isDisabled={Platform.OS !== "web"}
Expand Down
Loading