Skip to content

Commit

Permalink
feat(connect-kit): signInStrategy add noCharacterNeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
runjuu committed Jul 11, 2023
1 parent 9c4c0db commit 0f06422
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/connect-kit/src/connect-kit-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

export type SignInStrategy = "complete" | "simple";
export type SignInStrategy = "complete" | "simple" | "noCharacterNeeded";

export type ConnectKitConfig = {
signInStrategy: SignInStrategy;
Expand Down
8 changes: 7 additions & 1 deletion packages/connect-kit/src/modals/connect-modal/lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ function Main() {
goTo({ kind: SceneKind.selectCharacters });

const nextStrategies: Record<SignInStrategy, () => void> = {
noCharacterNeeded() {
hide();
},
simple() {
if (account.character) {
hide();
Expand Down Expand Up @@ -118,7 +121,10 @@ function renderScene({
return (
<SignInWithWallet
Header={Header}
autoSignIn={signInStrategy === "simple"}
autoSignIn={
signInStrategy === "simple" ||
signInStrategy === "noCharacterNeeded"
}
{...scene}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ export const [ScenesStoreProvider, useScenesStore] = createContextStore(() =>
],
});
},

noCharacterNeeded() {
set({
scenes: [
{ kind: SceneKind.selectConnectKind },
{ kind: SceneKind.selectWalletToConnect },
],
});
},
};

strategies[get().signInStrategy]();
Expand Down

0 comments on commit 0f06422

Please sign in to comment.