Skip to content

Commit

Permalink
Merge branch 'develop' into dev-tools/iota-core-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez authored Nov 6, 2024
2 parents a7f9849 + ae841a6 commit df99e54
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 49 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/apps_wallet_prod_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Wallet App (Prod)

on:
push:
tags:
- "wallet-v\d+\.\d+\.\d+"

env:
DEFAULT_NETWORK: ${{ secrets.WALLET_PROD_DEFAULT_NETWORK }}
IOTA_NETWORKS: ${{ secrets.WALLET_PROD_IOTA_NETWORKS }}
APPS_BACKEND: ${{ secrets.WALLET_PROD_APPS_BACKEND }}

jobs:
wallet-prod-build:
permissions:
contents: read
runs-on: [self-hosted]
steps:
- name: Checking out the repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # [email protected]
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # [email protected]
with:
path: apps/wallet
- name: Create artifact name
shell: bash
run: |
export artifact_name="iota-wallet-${{ steps.package-version.outputs.current-version }}"
echo "artifact_name=${artifact_name}" >> $GITHUB_ENV
- name: Build Wallet
run: pnpm wallet build
- name: Upload artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
with:
name: ${{ env.artifact_name }}
path: |
./apps/wallet/dist
63 changes: 14 additions & 49 deletions apps/wallet-dashboard/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,32 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
'use client';

import './globals.css';
import '@iota/dapp-kit/dist/index.css';
import './globals.css';
import { Inter } from 'next/font/google';
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 { ThemeProvider } from '@/contexts';
import { Metadata } from 'next';
import { AppProviders } from '@/providers';
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,
},
]}
>
<ThemeProvider>
<PopupProvider>
{children}
<Toaster
containerStyle={{
zIndex: 99999,
}}
/>
<Popup />
</PopupProvider>
</ThemeProvider>
</WalletProvider>
</IotaClientProvider>
</QueryClientProvider>
</GrowthBookProvider>
<body className={inter.className}>
<AppProviders>
<FontLinks />
{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} />;
}
55 changes: 55 additions & 0 deletions apps/wallet-dashboard/providers/AppProviders.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// 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';
import { ThemeProvider } from '@/contexts';

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,
},
]}
>
<ThemeProvider>
<PopupProvider>
{children}
<Toaster
containerStyle={{
zIndex: 99999,
}}
/>
<Popup />
</PopupProvider>
</ThemeProvider>
</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';

0 comments on commit df99e54

Please sign in to comment.