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

[FRE-1334] bump widget version, remove widget v1 and cleanup deps #456

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
48,563 changes: 21,469 additions & 27,094 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-tooltip": "^1.0.7",
"@skip-go/client": "^0.16.3",
"@skip-go/widget": "^3.1.5",
"@solana/web3.js": "^1.95.8",
"@tailwindcss/forms": "^0.5.7",
"@tanstack/query-sync-storage-persister": "^5.18.1",
Expand Down Expand Up @@ -64,8 +66,6 @@
"undici": "^6.6.1",
"viem": "^2.16.4",
"wagmi": "^2.5.7",
"widgetv1": "npm:@skip-go/widget@^2.5.2",
"widgetv2": "npm:@skip-go/[email protected]",
"zod": "^3.22.4",
"zustand": "^4.5.0"
},
Expand Down
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions src/ast/parse-chain-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export async function parseChainPaths({
parseAssetListJson({ registryPath: _registryPath, chainPath }),
parseChainJson({ registryPath: _registryPath, chainPath }),
]);

if (!assetlist) return;
if (!chain) return;

Expand Down
4 changes: 2 additions & 2 deletions src/lib/skip-go-widget.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SwapWidgetProviderProps } from "widgetv1";
import { WidgetProps } from "@skip-go/widget";

import { appUrl } from "@/constants/api";

export const endpointOptions: SwapWidgetProviderProps["endpointOptions"] = {
export const endpointOptions: WidgetProps["endpointOptions"] = {
getRpcEndpointForChain: async (chainID) => {
return `${appUrl}/api/rpc/${chainID}`;
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import "@/styles/globals.css";

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { Analytics } from "@vercel/analytics/react";
import { AppProps } from "next/app";
import React from "react";

import { DefaultSeo } from "@/components/DefaultSeo";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import React from "react";

export default function App({ Component, pageProps }: AppProps) {
const [queryClient] = React.useState(() => new QueryClient());
Expand Down
34 changes: 0 additions & 34 deletions src/pages/api/fee-assets/[chainID].ts

This file was deleted.

19 changes: 4 additions & 15 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import { useMemo } from "react";
import { defaultTheme, lightTheme, Widget } from "widgetv2";
import { Widget } from "@skip-go/widget";

import DiscordButton from "@/components/DiscordButton";
import { LogoGo } from "@/components/LogoGo";
import WidgetButton from "@/components/WidgetButton";
import { useFeatureEnabled } from "@/hooks/useFeatureEnabled";
// import { useFeatureEnabled } from "@/hooks/useFeatureEnabled";
import { useTheme } from "@/hooks/useTheme";
import { useURLQueryParams } from "@/hooks/useURLQueryParams";
import { apiURL, endpointOptions } from "@/lib/skip-go-widget";
import { isMobile } from "@/utils/os";
import { cn } from "@/utils/ui";

export default function Home() {
const defaultRoute = useURLQueryParams();
const goFast = useFeatureEnabled("goFastEnabled");
const theme = useTheme();
const mobile = useMemo(() => isMobile(), []);

if (!theme) return null;
return (
Expand All @@ -25,11 +21,7 @@ export default function Home() {
"relative overflow-x-hidden overflow-y-hidden",
"before:fixed before:inset-x-0 before:bottom-0 before:h-[100vh] before:content-['']",
"before:bg-cover before:bg-[center_top] before:bg-no-repeat",
theme === "dark"
? "before:bg-[url(/widgetv2-dark-bg.svg)]"
: theme === "light"
? "before:bg-[url(/widgetv2-light-bg.svg)]"
: "",
theme === "dark" ? "before:bg-[url(/dark-bg.svg)]" : theme === "light" ? "before:bg-[url(/light-bg.svg)]" : "",
)}
>
<main className="relative flex min-h-screen flex-col items-center">
Expand All @@ -52,13 +44,10 @@ export default function Home() {
}}
>
<Widget
theme={theme === "dark" ? defaultTheme : lightTheme}
theme={theme}
endpointOptions={endpointOptions}
apiUrl={apiURL}
defaultRoute={defaultRoute}
routeConfig={{
goFast,
}}
onlyTestnet={process.env.NEXT_PUBLIC_IS_TESTNET}
/>
</div>
Expand Down
33 changes: 0 additions & 33 deletions src/pages/widget.tsx

This file was deleted.

Loading