Skip to content

Commit

Permalink
fix cow amm submition
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesfracari committed Dec 4, 2024
1 parent a8a3114 commit ffd0c86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
11 changes: 3 additions & 8 deletions apps/withdraw-cow-amm/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
"use client";

import { RootLayout, WithdrawFormContextProvider } from "@bleu/cow-hooks-ui";
import { useGetHookInfo } from "#/hooks/useGetHookInfo";
import { RootLayout } from "@bleu/cow-hooks-ui";
import { WithdrawFormContextProvider } from "#/context/withdrawHookForm";
import "@bleu/cow-hooks-ui/global.css";
import Head from "next/head";

import type * as React from "react";

export default function Layout({ children }: { children: React.ReactNode }) {
const getHookInfo = useGetHookInfo();

return (
<html lang="en" className="h-screen">
<Head>
<link rel="manifest" href="/manifest.json" />
</Head>
<RootLayout>
<WithdrawFormContextProvider
getHookInfo={getHookInfo}
poolTypeIn="COW_AMM"
>
<WithdrawFormContextProvider poolTypeIn="COW_AMM">
{children}
</WithdrawFormContextProvider>
</RootLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
"use client";

import { useIFrameContext } from "@bleu/cow-hooks-ui/src/context/iframe";
import { useUserPools } from "@bleu/cow-hooks-ui/src/hooks/useUserPools";
import { Form } from "@bleu/ui";
import { type WithdrawSchemaType, withdrawSchema } from "@bleu/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { useRouter } from "next/navigation";
import { useCallback, useEffect, useMemo } from "react";
import { useForm, useWatch } from "react-hook-form";
import { useUserPools } from "../hooks/useUserPools";
import type { IHooksInfo, IPool } from "../types";
import { useIFrameContext } from "./iframe";
import { useGetHookInfo } from "#/hooks/useGetHookInfo";

export function WithdrawFormContextProvider({
children,
getHookInfo,
poolTypeIn,
}: {
children: React.ReactNode;
getHookInfo: (
selectedPool: IPool,
withdrawPct: number,
) => Promise<IHooksInfo | undefined>;
poolTypeIn: "COW_AMM" | "WEIGHTED";
}) {
const getHookInfo = useGetHookInfo();
const { context, setHookInfo } = useIFrameContext();

const form = useForm<WithdrawSchemaType>({
Expand Down
1 change: 0 additions & 1 deletion packages/cow-hooks-ui/src/context/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./iframe";
export * from "./tokenLogo";
export * from "./withdrawHookForm";

0 comments on commit ffd0c86

Please sign in to comment.