Skip to content
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
Prev Previous commit
fix build issue
  • Loading branch information
AyushBherwani1998 committed Jul 14, 2025
commit c391305074d1d3faa61e65f3994828bb4f369022
5 changes: 3 additions & 2 deletions examples/invitation-link-example/src/components/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import useDelegatorSmartAccount from "@/hooks/useDelegatorSmartAccount";
import { useStepContext } from "@/hooks/useStepContext";
import { decodeDelegation } from "@/utils/delegationUtils";
import AccountCard from "@/components/AccountCard";
import { Delegation } from "@metamask/delegation-toolkit";

export default function Steps() {
const { step, changeStep } = useStepContext();
const { address } = useAccount();
const [urlDelegation, setUrlDelegation] = useState<any>(null);
const [urlDelegation, setUrlDelegation] = useState<Delegation | null>(null);
const { smartAccount } = useDelegatorSmartAccount();

useEffect(() => {
Expand Down Expand Up @@ -117,7 +118,7 @@ export default function Steps() {
Claim the reward by submitting a transaction on the network.
</p>

<ClaimRewardButton delegation={urlDelegation} />
<ClaimRewardButton delegation={urlDelegation!} />
</>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { createContext, useCallback, useState } from "react";

export const StepContext = createContext({
type ChangeStep = (step: number) => void;

export const StepContext = createContext<{
step: number;
changeStep: ChangeStep;
}>({
step: 1,
changeStep: (_: number) => {},
changeStep: () => {},
});

export const StepProvider = ({ children }: { children: React.ReactNode }) => {
Expand All @@ -12,7 +17,7 @@ export const StepProvider = ({ children }: { children: React.ReactNode }) => {
(step: number) => {
setStep(step);
},
[step]
[]
);

return (
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"scripts": {
"dev": "turbo run dev",
"dev:invitation-link-example": "turbo run dev --filter=./examples/invitation-link-example",
"build:invitation-link-example": "turbo run build --filter=./examples/invitation-link-example",
"build": "turbo run build --cache-dir=.turbo --filter=./packages/create-gator-app",
"lint": "turbo lint",
"clean": "turbo clean",
Expand Down
Loading