From a351dd6fc1634a52613141ac3a7e9dd2ddf22fbc Mon Sep 17 00:00:00 2001 From: Elliot Sayes Date: Wed, 24 Apr 2024 23:04:30 +0800 Subject: [PATCH 1/3] Nicer toast --- src/components/GameLoader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/GameLoader.tsx b/src/components/GameLoader.tsx index 29994db..c67ca7e 100644 --- a/src/components/GameLoader.tsx +++ b/src/components/GameLoader.tsx @@ -224,7 +224,7 @@ export const GameLoader = () => { return true; }} /> - + ); }; From e320ff31d3bc2c1c242bad321bfa690035fc4212 Mon Sep 17 00:00:00 2001 From: Elliot Sayes Date: Wed, 24 Apr 2024 23:15:17 +0800 Subject: [PATCH 2/3] Irys => Turbo --- .env | 4 +- src/components/upload/SubmitSuccessDialog.tsx | 9 +++- src/components/upload/SubmittingDialog.tsx | 2 +- src/components/upload/UploadPage.tsx | 2 +- src/config.ts | 6 +-- src/lib/machines/upload_page.ts | 4 +- src/lib/{bundlr.ts => turbo.ts} | 24 +++++----- src/routeTree.gen.ts | 44 +++++++++---------- 8 files changed, 50 insertions(+), 45 deletions(-) rename src/lib/{bundlr.ts => turbo.ts} (91%) diff --git a/.env b/.env index 583ebf4..7f3f002 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ VITE_CONFIG_ARSEEDING_URL="https://arseed.web3infra.dev" VITE_CONFIG_ARSEEDING_DEFAULT_SYMBOL="AR" -VITE_CONFIG_BUNDLR_NODE="node2" -VITE_CONFIG_UPLOADER="bundlr" +VITE_CONFIG_BUNDLER_URL="https://turbo.ardrive.io" +VITE_CONFIG_UPLOADER="turbo" VITE_CONFIG_RENDERER_ARNS="udl-video-renderer" VITE_CONFIG_RENDERER_TX_ID="sAmG5LJGY9c7LFz24MXULeC_v73qNwotEUpbis3QSHQ" \ No newline at end of file diff --git a/src/components/upload/SubmitSuccessDialog.tsx b/src/components/upload/SubmitSuccessDialog.tsx index b3617ba..8daa227 100644 --- a/src/components/upload/SubmitSuccessDialog.tsx +++ b/src/components/upload/SubmitSuccessDialog.tsx @@ -9,6 +9,7 @@ import type { ContentType, UploadResult } from "@/lib/upload"; import { Button } from "../ui/button"; import TextView from "./TextView"; import { VideoPreview } from "./VideoPreview"; +import { useState } from "react"; interface Props { contentType: ContentType; @@ -20,6 +21,8 @@ interface Props { export const SubmitSuccessDialog = (props: Props) => { const { contentType, mainVideoResult, onAccept } = props; + const [isDone, setIsDone] = useState(false); + const renderResult = ( // title: string, result: UploadResult, @@ -88,7 +91,11 @@ export const SubmitSuccessDialog = (props: Props) => { */}
{renderResult(mainVideoResult)}
- + ); }; diff --git a/src/components/upload/SubmittingDialog.tsx b/src/components/upload/SubmittingDialog.tsx index 60570ec..15bc34b 100644 --- a/src/components/upload/SubmittingDialog.tsx +++ b/src/components/upload/SubmittingDialog.tsx @@ -19,7 +19,7 @@ export const SubmittingDialog = (props: Props) => { - Uploading with {isArseeding ? "Everpay" : "Bundlr"} + Uploading with {isArseeding ? "Everpay" : "Turbo"} Please wait while your data is uploading... diff --git a/src/components/upload/UploadPage.tsx b/src/components/upload/UploadPage.tsx index d1d759a..74e9eed 100644 --- a/src/components/upload/UploadPage.tsx +++ b/src/components/upload/UploadPage.tsx @@ -138,7 +138,7 @@ export const UploadPage = ({ onDone }: UploadPageProps) => { }`} disabled={!canSumbit} > - Upload With Bundlr + Upload With Turbo diff --git a/src/config.ts b/src/config.ts index e3e1211..7ebeb8a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,10 +1,8 @@ export const config = { arseedingUrl: import.meta.env.VITE_CONFIG_ARSEEDING_URL, arseedingDefaultSymbol: import.meta.env.VITE_CONFIG_ARSEEDING_DEFAULT_SYMBOL, - bundlrNode: import.meta.env.VITE_CONFIG_BUNDLR_NODE, - uploader: (import.meta.env.VITE_CONFIG_UPLOADER ?? "arseeding") as - | "arseeding" - | "bundlr", + bundlerUrl: import.meta.env.VITE_CONFIG_BUNDLER_URL, + uploader: import.meta.env.VITE_CONFIG_UPLOADER ?? "turbo", rendererArns: import.meta.env.VITE_CONFIG_RENDERER_ARNS as string, defaultRendererTxId: import.meta.env.VITE_CONFIG_RENDERER_TX_ID as | string diff --git a/src/lib/machines/upload_page.ts b/src/lib/machines/upload_page.ts index 0ad55f6..32e3b02 100644 --- a/src/lib/machines/upload_page.ts +++ b/src/lib/machines/upload_page.ts @@ -4,7 +4,7 @@ import type { ContentType, UploadResult } from "@/lib/upload"; import mime from "mime-types"; import { type EventObject, assign, fromCallback, setup } from "xstate"; import type { z } from "zod"; -import { uploadVideosToBundlr } from "../bundlr"; +import { uploadVideosToTurbo } from "../turbo"; type Events = | { @@ -144,7 +144,7 @@ export const uploadPageMachine = setup({ : "text" : "text"; - uploadVideosToBundlr( + uploadVideosToTurbo( contentType, mainVideo!, "arweave", diff --git a/src/lib/bundlr.ts b/src/lib/turbo.ts similarity index 91% rename from src/lib/bundlr.ts rename to src/lib/turbo.ts index 396c65d..c0f10a1 100644 --- a/src/lib/bundlr.ts +++ b/src/lib/turbo.ts @@ -16,15 +16,15 @@ import { export const getUploadFee = async (fileSize: number, token: string) => { if (fileSize < 10 * 1024) return BigNumber(0); - const bundlr = new WebIrys({ - url: config.bundlrNode, + const turbo = new WebIrys({ + url: config.bundlerUrl, token, }); - const fee = await bundlr.getPrice(fileSize); + const fee = await turbo.getPrice(fileSize); return fee; }; -// Function to connect to bundlr instance +// Function to connect to turbo instance const connectInstance = async (token: string) => { const injectedArweave = window.arweaveWallet; await injectedArweave.connect([ @@ -32,17 +32,17 @@ const connectInstance = async (token: string) => { "SIGNATURE", "SIGN_TRANSACTION", ]); - const bundlr = new WebIrys({ - url: config.bundlrNode, + const turbo = new WebIrys({ + url: config.bundlerUrl, token, wallet: { provider: injectedArweave, }, }); - await bundlr.ready(); + await turbo.ready(); return { - instance: bundlr, - address: bundlr.address!, + instance: turbo, + address: turbo.address!, }; }; @@ -51,7 +51,7 @@ const getBalance = async (instance: WebIrys) => { return instance.getLoadedBalance(); }; -// Function to upload file to bundlr +// Function to upload file to turbo const uploadFile = async ( instance: WebIrys, file: File, @@ -76,7 +76,7 @@ const uploadFile = async ( }; }; -export const uploadVideosToBundlr = async ( +export const uploadVideosToTurbo = async ( contentType: ContentType, mainVideo: File, token: string, @@ -140,7 +140,7 @@ export const uploadVideosToBundlr = async ( const mainVideoResult = await uploadFile(instance, mainVideo, mainVideoTags); log?.("SKIPPING: Registering atomic asset with Warp..."); - // const result = await ensureRegistered(mainVideoResult.id, config.bundlrNode); + // const result = await ensureRegistered(mainVideoResult.id, config.turboNode); // log?.(`Registered with Warp: ${JSON.stringify(await result.json())}`); try { diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 7ec4d79..b1a0a03 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -8,46 +8,46 @@ // This file is auto-generated by TanStack Router -import { createFileRoute } from "@tanstack/react-router"; +import { createFileRoute } from '@tanstack/react-router' // Import Routes -import { Route as rootRoute } from "./routes/__root"; +import { Route as rootRoute } from './routes/__root' // Create Virtual Routes -const GameLazyImport = createFileRoute("/game")(); -const IndexLazyImport = createFileRoute("/")(); +const GameLazyImport = createFileRoute('/game')() +const IndexLazyImport = createFileRoute('/')() // Create/Update Routes const GameLazyRoute = GameLazyImport.update({ - path: "/game", - getParentRoute: () => rootRoute, -} as any).lazy(() => import("./routes/game.lazy").then((d) => d.Route)); + path: '/game', + getParentRoute: () => rootRoute, +} as any).lazy(() => import('./routes/game.lazy').then((d) => d.Route)) const IndexLazyRoute = IndexLazyImport.update({ - path: "/", - getParentRoute: () => rootRoute, -} as any).lazy(() => import("./routes/index.lazy").then((d) => d.Route)); + path: '/', + getParentRoute: () => rootRoute, +} as any).lazy(() => import('./routes/index.lazy').then((d) => d.Route)) // Populate the FileRoutesByPath interface -declare module "@tanstack/react-router" { - interface FileRoutesByPath { - "/": { - preLoaderRoute: typeof IndexLazyImport; - parentRoute: typeof rootRoute; - }; - "/game": { - preLoaderRoute: typeof GameLazyImport; - parentRoute: typeof rootRoute; - }; - } +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + preLoaderRoute: typeof IndexLazyImport + parentRoute: typeof rootRoute + } + '/game': { + preLoaderRoute: typeof GameLazyImport + parentRoute: typeof rootRoute + } + } } // Create and export the route tree -export const routeTree = rootRoute.addChildren([IndexLazyRoute, GameLazyRoute]); +export const routeTree = rootRoute.addChildren([IndexLazyRoute, GameLazyRoute]) /* prettier-ignore-end */ From 5ecfb9c1c4cacd386f8cda5a9fc1b76170446d4a Mon Sep 17 00:00:00 2001 From: Elliot Sayes Date: Thu, 25 Apr 2024 05:11:27 +0800 Subject: [PATCH 3/3] Fix long words --- src/components/GatherChat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/GatherChat.tsx b/src/components/GatherChat.tsx index f7a0904..a225e12 100644 --- a/src/components/GatherChat.tsx +++ b/src/components/GatherChat.tsx @@ -122,7 +122,7 @@ export const GatherChat = ({ key={post.id} className={`${toon?.isFollowing ? "bg-blue-100" : ""} ${ isUser ? "bg-gray-200" : "" - }`} + } break-words max-w-sm`} >