Skip to content

Commit

Permalink
chore: merge v3-main, resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Nov 25, 2024
2 parents 7b847dd + fe568d4 commit 048164b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 34 deletions.
10 changes: 5 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ const nextConfig = {
},
async redirects() {
return [
// {
// source: "/",
// destination: "/explorer",
// permanent: false,
// },
{
source: "/",
destination: "/explorer",
permanent: false,
},
{
source: "/buildonbase/:path*",
destination: "/base/:path*",
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
10 changes: 0 additions & 10 deletions src/app/(dashboard)/page.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Card } from "./ui/Card";
export const Header = () => (
<header className="flex h-14 items-center justify-between gap-4 p-2">
{/* TODO: NavMenu component */}
<Card className="h-11 w-24 rounded-xl" />
<Card className="h-11 w-24" />

<Card className="rounded-xl">
<Card>
<AuthBoundary fallback={<SignInButton variant="ghost" />}>
<SignOutButton />
</AuthBoundary>
Expand Down
20 changes: 11 additions & 9 deletions src/components/SignInDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import { signIn } from "@/actions/auth";
import { signInDialogOpenAtom } from "@/config/atoms";
import { env } from "@/lib/env";
import { SignIn, User, Wallet } from "@phosphor-icons/react/dist/ssr";
import { SignIn, User, Wallet, XCircle } from "@phosphor-icons/react/dist/ssr";
import { DialogDescription } from "@radix-ui/react-dialog";
import { useMutation } from "@tanstack/react-query";
import { useAtom, useSetAtom } from "jotai";
import { shortenHex } from "lib/shortenHex";
import { toast } from "sonner";
import { createSiweMessage } from "viem/siwe";
import { useAccount, useConnect, useSignMessage } from "wagmi";
import { z } from "zod";
Expand Down Expand Up @@ -89,19 +90,13 @@ const SignInWithEthereum = () => {
const { nonce } = await fetch(`${env.NEXT_PUBLIC_API}/auth/siwe/nonce`)
.then((res) => res.json())
.then((data) => z.object({ nonce: z.string() }).parse(data));
const urlHostname = [
new URL(env.NEXT_PUBLIC_URL).hostname,
window.location.port,
]
.filter(Boolean)
.join(":");

const message = createSiweMessage({
address: address!,

Check warning on line 95 in src/components/SignInDialog.tsx

View workflow job for this annotation

GitHub Actions / quality-assurance

lint/style/noNonNullAssertion

Forbidden non-null assertion.
chainId: 1,
domain: urlHostname,
domain: new URL(env.NEXT_PUBLIC_SIWE_URL).hostname,
nonce,
uri: urlHostname,
uri: env.NEXT_PUBLIC_SIWE_URL,
version: "1",
});

Expand All @@ -110,6 +105,13 @@ const SignInWithEthereum = () => {
return signIn({ message, signature });
},
onSuccess: () => setSignInDialogOpen(false),
onError: (error) => {
toast("Sign in error", {
description: error.message,
icon: <XCircle weight="fill" className="text-icon-error" />,
});
console.error(error);
},
});

return (
Expand Down
2 changes: 1 addition & 1 deletion src/config/pinata.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { env } from "@/lib/env";
import { PinataSDK } from "pinata-web3";

export const pinata = new PinataSDK({
pinataJwt: `${env.PINATA_JWT}`,
pinataJwt: `${env.PINATA_ADMIN_JWT}`,
pinataGateway: `${env.NEXT_PUBLIC_PINATA_GATEWAY_URL}`,
});
14 changes: 7 additions & 7 deletions src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { z } from "zod";

export const env = createEnv({
server: {
PINATA_JWT: z.string(),
PINATA_ADMIN_JWT: z.string(),
},
client: {
NEXT_PUBLIC_API: z.string(),
NEXT_PUBLIC_URL: z.string(),
NEXT_PUBLIC_SIWE_URL: z.string(),
NEXT_PUBLIC_PINATA_GATEWAY_URL: z.string(),
},
runtimeEnv: {
NEXT_PUBLIC_API: process.env.NEXT_PUBLIC_API,
NEXT_PUBLIC_URL:
NEXT_PUBLIC_API: process.env.NEXT_PUBLIC_API_V3,
NEXT_PUBLIC_SIWE_URL:
process.env.NODE_ENV === "production"
? process.env.NEXT_PUBLIC_URL
: "http://localhost",
PINATA_JWT: process.env.PINATA_JWT,
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: "http://localhost:3000",
PINATA_ADMIN_JWT: process.env.PINATA_ADMIN_JWT,
NEXT_PUBLIC_PINATA_GATEWAY_URL: process.env.NEXT_PUBLIC_PINATA_GATEWAY_URL,
},
});

0 comments on commit 048164b

Please sign in to comment.