Skip to content
Closed
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
2 changes: 1 addition & 1 deletion frontend/.astro/data-store.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.14.1","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"server\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":true,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":false,\"port\":4321,\"streaming\":true,\"allowedHosts\":[]},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\",\"entrypoint\":\"astro/assets/endpoint/node\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[],\"responsiveStyles\":false},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":{\"type\":\"shiki\",\"excludeLangs\":[\"math\"]},\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"github-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"headingIdCompat\":false,\"preserveScriptOrder\":false,\"liveContentCollections\":false,\"csp\":false,\"staticImportMetaEnv\":false,\"chromeDevtoolsWorkspace\":false,\"failOnPrerenderConflict\":false},\"legacy\":{\"collections\":false},\"session\":{\"driver\":\"fs-lite\",\"options\":{\"base\":\"/Users/antoineestienne/GithubRepositories/TheGuildGenesis/frontend/node_modules/.astro/sessions\"}}}"]
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.13.7","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"server\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":true,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":false,\"port\":4321,\"streaming\":true,\"allowedHosts\":[]},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\",\"entrypoint\":\"astro/assets/endpoint/node\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[],\"responsiveStyles\":false},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":{\"type\":\"shiki\",\"excludeLangs\":[\"math\"]},\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"github-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"headingIdCompat\":false,\"preserveScriptOrder\":false,\"liveContentCollections\":false,\"csp\":false,\"staticImportMetaEnv\":false,\"chromeDevtoolsWorkspace\":false},\"legacy\":{\"collections\":false},\"session\":{\"driver\":\"fs-lite\",\"options\":{\"base\":\"/Users/theodoreabitbol/Desktop/TheGuildGenesis/frontend/node_modules/.astro/sessions\"}}}"]
197 changes: 167 additions & 30 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion frontend/src/components/AppWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "@rainbow-me/rainbowkit/styles.css";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { WagmiProvider } from "wagmi";
import { RainbowKitProvider } from "@rainbow-me/rainbowkit";
import { config } from "../lib/wagmi";
import { getWagmiConfig } from "../lib/wagmi";
import { ConnectButton } from "@rainbow-me/rainbowkit";
import {
SidebarProvider,
Expand All @@ -20,6 +20,9 @@ interface AppWrapperProps {
}

export function AppWrapper({ children }: AppWrapperProps) {
// call the config getter inside the client component so it runs in the browser
const config = getWagmiConfig();

return (
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
Expand Down
31 changes: 17 additions & 14 deletions frontend/src/lib/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ import { getDefaultConfig } from "@rainbow-me/rainbowkit";
import { http } from "wagmi";
import { polygonAmoy } from "wagmi/chains";

const projectId = import.meta.env.PUBLIC_WALLET_CONNECT_PROJECT_ID as
| string
| undefined;
console.log(projectId);
export const config = getDefaultConfig({
appName: "The Guild Genesis",
projectId: projectId ?? "",
chains: [polygonAmoy],
ssr: false,
syncConnectedChain: true,
transports: {
[polygonAmoy.id]: http(),
},
});
export function getWagmiConfig() {
const projectId = import.meta.env.PUBLIC_WALLET_CONNECT_PROJECT_ID as
| string
| undefined;

// In tests or dev without a project id, the consumer can handle an empty string.
return getDefaultConfig({
appName: "The Guild Genesis",
projectId: projectId ?? "",
chains: [polygonAmoy],
ssr: false,
syncConnectedChain: true,
transports: {
[polygonAmoy.id]: http(),
},
});
}
7 changes: 4 additions & 3 deletions frontend/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import HomePage from '@/components/pages/HomePage';

<Layout title="The Guild Genesis">
<div class="min-h-screen bg-gray-50">
<AppWrapper client:only="react">
<HomePage/>
</AppWrapper>
<!-- Temporary server-rendered fallback: render HomePage directly to test SSR output -->
<div>
<HomePage />
</div>
</div>
</Layout>
4 changes: 2 additions & 2 deletions frontend/src/test/AppWrapper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ vi.mock("@rainbow-me/rainbowkit", () => ({
getDefaultConfig: () => ({}),
}));

// Mock the wagmi config
// Mock the wagmi config getter
vi.mock("@/lib/wagmi", () => ({
config: {},
getWagmiConfig: () => ({}),
}));

describe("AppWrapper", () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/test/ProfileCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ vi.mock("@rainbow-me/rainbowkit", () => ({
getDefaultConfig: () => ({}),
}));

// Mock the wagmi config
// Mock the wagmi config getter
vi.mock("@/lib/wagmi", () => ({
config: {},
getWagmiConfig: () => ({}),
}));

describe("ProfileCard", () => {
Expand Down
Loading
Loading