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

feat(wallet-dashboard): add missing link for AllianceNo2 #3825

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
52 changes: 12 additions & 40 deletions apps/wallet-dashboard/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,32 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
'use client';

import { Inter } from 'next/font/google';

import '@iota/dapp-kit/dist/index.css';
import './globals.css';
import { GrowthBookProvider } from '@growthbook/growthbook-react';
import { IotaClientProvider, lightTheme, darkTheme, WalletProvider } from '@iota/dapp-kit';
import { getAllNetworks, getDefaultNetwork } from '@iota/iota-sdk/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React from 'react';
import '@iota/dapp-kit/dist/index.css';
import { Popup, PopupProvider } from '@/components/Popup';
import { growthbook } from '@/lib/utils';
import { Toaster } from 'react-hot-toast';
import { AppProviders } from '@/providers';
import { Metadata } from 'next';
import { FontLinks } from '@/components/FontLinks';

const inter = Inter({ subsets: ['latin'] });
growthbook.init();

export const metadata: Metadata = {
title: 'IOTA Wallet Dashboard',
description: 'IOTA Wallet Dashboard',
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const [queryClient] = React.useState(() => new QueryClient());
const bodyRef = React.useRef<HTMLBodyElement>(null);

const allNetworks = getAllNetworks();
const defaultNetwork = getDefaultNetwork();

return (
<html lang="en">
<body className={inter.className} ref={bodyRef}>
<GrowthBookProvider growthbook={growthbook}>
<QueryClientProvider client={queryClient}>
<IotaClientProvider networks={allNetworks} defaultNetwork={defaultNetwork}>
<WalletProvider
theme={[
{
variables: lightTheme,
},
{
selector: '.dark',
variables: darkTheme,
},
]}
>
<PopupProvider>
{children}
<Toaster />
<Popup />
</PopupProvider>
</WalletProvider>
</IotaClientProvider>
</QueryClientProvider>
</GrowthBookProvider>
<body className={inter.className}>
<FontLinks />
<AppProviders>{children}</AppProviders>
</body>
</html>
);
Expand Down
8 changes: 8 additions & 0 deletions apps/wallet-dashboard/components/FontLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

const ALLIANCE_NO2_FONT_URL = 'https://webassets.iota.org/api/protected?face=alliance-no2';

export function FontLinks() {
return <link rel="stylesheet" href={ALLIANCE_NO2_FONT_URL} />;
}
48 changes: 48 additions & 0 deletions apps/wallet-dashboard/providers/AppProviders.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

'use client';

import { PopupProvider } from '@/components';
import { GrowthBookProvider } from '@growthbook/growthbook-react';
import { IotaClientProvider, lightTheme, darkTheme, WalletProvider } from '@iota/dapp-kit';
import { getAllNetworks, getDefaultNetwork } from '@iota/iota-sdk/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useState } from 'react';
import { growthbook } from '@/lib/utils';
import { Popup } from '@/components/Popup';
import { Toaster } from 'react-hot-toast';

growthbook.init();

export function AppProviders({ children }: React.PropsWithChildren) {
const [queryClient] = useState(() => new QueryClient());
const allNetworks = getAllNetworks();
const defaultNetwork = getDefaultNetwork();

return (
<GrowthBookProvider growthbook={growthbook}>
<QueryClientProvider client={queryClient}>
<IotaClientProvider networks={allNetworks} defaultNetwork={defaultNetwork}>
<WalletProvider
theme={[
{
variables: lightTheme,
},
{
selector: '.dark',
variables: darkTheme,
},
]}
>
<PopupProvider>
{children}
<Toaster />
<Popup />
</PopupProvider>
</WalletProvider>
</IotaClientProvider>
</QueryClientProvider>
</GrowthBookProvider>
);
}
4 changes: 4 additions & 0 deletions apps/wallet-dashboard/providers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

export * from './AppProviders';
Loading