Skip to content

Commit

Permalink
Merge branch 'develop' into devx/fix-sidebar-highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekjain23 authored Dec 12, 2024
2 parents fb2ec24 + 3090a3b commit d966a2e
Show file tree
Hide file tree
Showing 8 changed files with 688 additions and 524 deletions.
9 changes: 5 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
# Changes to the genesis builder should be approved by Konstantinos or Mirko at least
/crates/iota-genesis-builder/ @kodemartin @miker83z

# vm-language team
/iota-execution/ @iotaledger/vm-language
/external-crates/ @iotaledger/vm-language

# infrastructure team
/docker/ @iotaledger/infrastructure @iotaledger/node @iotaledger/devops-admin
/crates/iota-json-rpc*/ @iotaledger/infrastructure
Expand Down Expand Up @@ -61,6 +57,11 @@ prettier.config.js @iotaledger/tooling
turbo.json @iotaledger/tooling
vercel.json @iotaledger/tooling

# vm-language team
# Needs to be after package.json ownership definition to override it
/iota-execution/ @iotaledger/vm-language
/external-crates/ @iotaledger/vm-language

# Docs and examples are for DevEx to approve upon
/docs/ @iotaledger/devx
/examples/ @iotaledger/devx
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,3 @@ jobs:
# env:
# # https://github.com/settings/tokens/new?scopes=public_repo,workflow
# COMMITTER_TOKEN: ${{ secrets.HOMEBREW_GH_FORMULA_BUMP }}
#
# # Tag all iota images with release tag, so that they can be easily found
# tag-docker-hub-images:
# runs-on: ubuntu-latest
# steps:
# - name: Dispatch Tagging of images in DockerHub, in MystenLabs/sui-operations
# uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
# with:
# repository: iotaledger/iota
# token: ${{ secrets.DOCKER_BINARY_BUILDS_DISPATCH }}
# event-type: tag-docker-images
# client-payload: '{"iota_commit": "${{ github.sha }}", "repo_name": "all", "tag": "${{ env.TAG_NAME }}"}'
2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"@vitejs/plugin-react": "^4.3.1",
"@vitest/ui": "^0.33.0",
"autoprefixer": "^10.4.19",
"happy-dom": "^10.5.1",
"happy-dom": "^15.11.7",
"onchange": "^7.1.0",
"postcss": "^8.4.31",
"start-server-and-test": "^2.0.0",
Expand Down
154 changes: 108 additions & 46 deletions apps/wallet-dashboard/app/(protected)/migrations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,39 @@
// SPDX-License-Identifier: Apache-2.0
'use client';

import { VirtualList } from '@/components';
import MigratePopup from '@/components/Popup/Popups/MigratePopup';
import { useGetStardustMigratableObjects, usePopups } from '@/hooks';
import { Button } from '@iota/apps-ui-kit';
import { useCurrentAccount, useIotaClient, useIotaClientContext } from '@iota/dapp-kit';
import { STARDUST_BASIC_OUTPUT_TYPE, STARDUST_NFT_OUTPUT_TYPE } from '@iota/core';
import { getNetwork, IotaObjectData } from '@iota/iota-sdk/client';
import { usePopups } from '@/hooks';
import { summarizeMigratableObjectValues } from '@/lib/utils';
import {
Button,
ButtonSize,
ButtonType,
Card,
CardBody,
CardImage,
ImageShape,
Panel,
Title,
} from '@iota/apps-ui-kit';
import { useCurrentAccount, useIotaClient } from '@iota/dapp-kit';
import { STARDUST_BASIC_OUTPUT_TYPE, STARDUST_NFT_OUTPUT_TYPE, useFormatCoin } from '@iota/core';
import { useGetStardustMigratableObjects } from '@/hooks';
import { useQueryClient } from '@tanstack/react-query';
import { Assets, Clock, IotaLogoMark, Tokens } from '@iota/ui-icons';
import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils';

interface MigrationDisplayCard {
title: string;
subtitle: string;
icon: React.FC;
}

function MigrationDashboardPage(): JSX.Element {
const account = useCurrentAccount();
const address = account?.address || '';
const { openPopup, closePopup } = usePopups();
const queryClient = useQueryClient();
const iotaClient = useIotaClient();
const { network } = useIotaClientContext();
const { explorer } = getNetwork(network);

const {
migratableBasicOutputs,
Expand All @@ -30,12 +46,6 @@ function MigrationDashboardPage(): JSX.Element {
const hasMigratableObjects =
migratableBasicOutputs.length > 0 || migratableNftOutputs.length > 0;

const virtualItem = (asset: IotaObjectData): JSX.Element => (
<a href={`${explorer}/object/${asset.objectId}`} target="_blank" rel="noreferrer">
{asset.objectId}
</a>
);

function handleOnSuccess(digest: string): void {
iotaClient
.waitForTransaction({
Expand Down Expand Up @@ -73,41 +83,93 @@ function MigrationDashboardPage(): JSX.Element {
);
}

const {
accumulatedIotaAmount: accumulatedTimelockedIotaAmount,
totalNativeTokens,
totalVisualAssets,
} = summarizeMigratableObjectValues({
migratableBasicOutputs,
migratableNftOutputs,
address,
});

const [timelockedIotaTokens, symbol] = useFormatCoin(
accumulatedTimelockedIotaAmount,
IOTA_TYPE_ARG,
);

const MIGRATION_CARDS: MigrationDisplayCard[] = [
{
title: `${timelockedIotaTokens} ${symbol}`,
subtitle: 'IOTA Tokens',
icon: IotaLogoMark,
},
{
title: `${totalNativeTokens}`,
subtitle: 'Native Tokens',
icon: Tokens,
},
{
title: `${totalVisualAssets}`,
subtitle: 'Visual Assets',
icon: Assets,
},
];

const timelockedAssetsAmount = unmigratableBasicOutputs.length + unmigratableNftOutputs.length;
const TIMELOCKED_ASSETS_CARDS: MigrationDisplayCard[] = [
{
title: `${timelockedAssetsAmount}`,
subtitle: 'Time-locked',
icon: Clock,
},
];

return (
<div className="flex h-full w-full flex-wrap items-center justify-center space-y-4">
<div className="flex w-1/2 flex-col">
<h1>Migratable Basic Outputs: {migratableBasicOutputs.length}</h1>
<VirtualList
items={migratableBasicOutputs}
estimateSize={() => 30}
render={virtualItem}
/>
</div>
<div className="flex w-1/2 flex-col">
<h1>Unmigratable Basic Outputs: {unmigratableBasicOutputs.length}</h1>
<VirtualList
items={unmigratableBasicOutputs}
estimateSize={() => 30}
render={virtualItem}
/>
</div>
<div className="flex w-1/2 flex-col">
<h1>Migratable NFT Outputs: {migratableNftOutputs.length}</h1>
<VirtualList
items={migratableNftOutputs}
estimateSize={() => 30}
render={virtualItem}
/>
</div>
<div className="flex w-1/2 flex-col">
<h1>Unmigratable NFT Outputs: {unmigratableNftOutputs.length}</h1>
<VirtualList
items={unmigratableNftOutputs}
estimateSize={() => 30}
render={virtualItem}
/>
<div className="flex w-full flex-row justify-center">
<div className="flex w-1/3 flex-col gap-md--rs">
<Panel>
<Title
title="Migration"
trailingElement={
<Button
text="Migrate All"
disabled={!hasMigratableObjects}
onClick={openMigratePopup}
size={ButtonSize.Small}
/>
}
/>
<div className="flex flex-col gap-xs p-md--rs">
{MIGRATION_CARDS.map((card) => (
<Card key={card.subtitle}>
<CardImage shape={ImageShape.SquareRounded}>
<card.icon />
</CardImage>
<CardBody title={card.title} subtitle={card.subtitle} />
</Card>
))}
<Button text="See All" type={ButtonType.Ghost} fullWidth />
</div>
</Panel>

<Panel>
<Title title="Time-locked Assets" />
<div className="flex flex-col gap-xs p-md--rs">
{TIMELOCKED_ASSETS_CARDS.map((card) => (
<Card key={card.subtitle}>
<CardImage shape={ImageShape.SquareRounded}>
<card.icon />
</CardImage>
<CardBody title={card.title} subtitle={card.subtitle} />
</Card>
))}
<Button text="See All" type={ButtonType.Ghost} fullWidth />
</div>
</Panel>
</div>
</div>
<Button text="Migrate" disabled={!hasMigratableObjects} onClick={openMigratePopup} />
</div>
);
}
Expand Down
84 changes: 45 additions & 39 deletions apps/wallet-dashboard/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,69 @@

'use client';

import { ConnectButton, useCurrentAccount, useCurrentWallet } from '@iota/dapp-kit';
import { useEffect } from 'react';
import { ConnectButton, useCurrentWallet, useAutoConnectWallet } from '@iota/dapp-kit';
import { redirect } from 'next/navigation';
import { IotaLogoWeb } from '@iota/ui-icons';
import { HOMEPAGE_ROUTE } from '@/lib/constants/routes.constants';
import { Theme, useTheme } from '@iota/core';
import { LoadingIndicator } from '@iota/apps-ui-kit';

function HomeDashboardPage(): JSX.Element {
const { theme } = useTheme();
const { connectionStatus } = useCurrentWallet();
const account = useCurrentAccount();
const { isConnected } = useCurrentWallet();
const autoConnect = useAutoConnectWallet();

if (isConnected) {
redirect(HOMEPAGE_ROUTE.path);
}

const CURRENT_YEAR = new Date().getFullYear();
const videoSrc =
theme === Theme.Dark
? 'https://files.iota.org/media/tooling/wallet-dashboard-welcome-dark.mp4'
: 'https://files.iota.org/media/tooling/wallet-dashboard-welcome-light.mp4';

useEffect(() => {
if (connectionStatus === 'connected' && account) {
redirect(HOMEPAGE_ROUTE.path);
}
}, [connectionStatus, account]);

return (
<main className="flex h-screen">
<div className="relative hidden sm:flex md:w-1/3">
<video
key={theme}
src={videoSrc}
autoPlay
muted
loop
className="absolute right-0 top-0 h-full w-full min-w-fit object-cover"
disableRemotePlayback
></video>
</div>
<div className="flex h-full w-full flex-col items-center justify-between p-md sm:p-2xl">
<IotaLogoWeb width={130} height={32} />
<div className="flex max-w-sm flex-col items-center gap-8 text-center">
<div className="flex flex-col items-center gap-4">
<span className="text-headline-sm text-neutral-40">Welcome to</span>
<h1 className="text-display-lg text-neutral-10 dark:text-neutral-100">
IOTA Wallet
</h1>
<span className="text-title-lg text-neutral-40">
Connecting you to the decentralized web and IOTA network
</span>
{autoConnect === 'idle' ? (
<div className="flex w-full justify-center">
<LoadingIndicator size="w-16 h-16" />
</div>
) : (
<>
<div className="relative hidden sm:flex md:w-1/3">
<video
key={theme}
src={videoSrc}
autoPlay
muted
loop
className="absolute right-0 top-0 h-full w-full min-w-fit object-cover"
disableRemotePlayback
></video>
</div>
<div className="[&_button]:!bg-neutral-90 [&_button]:dark:!bg-neutral-20">
<ConnectButton connectText="Connect" />
<div className="flex h-full w-full flex-col items-center justify-between p-md sm:p-2xl">
<IotaLogoWeb width={130} height={32} />
<div className="flex max-w-sm flex-col items-center gap-8 text-center">
<div className="flex flex-col items-center gap-4">
<span className="text-headline-sm text-neutral-40">Welcome to</span>
<h1 className="text-display-lg text-neutral-10 dark:text-neutral-100">
IOTA Wallet
</h1>
<span className="text-title-lg text-neutral-40">
Connecting you to the decentralized web and IOTA network
</span>
</div>
<div className="[&_button]:!bg-neutral-90 [&_button]:dark:!bg-neutral-20">
<ConnectButton connectText="Connect" />
</div>
</div>
<div className="text-body-lg text-neutral-60">
&copy; IOTA Foundation {CURRENT_YEAR}
</div>
</div>
</div>
<div className="text-body-lg text-neutral-60">
&copy; IOTA Foundation {CURRENT_YEAR}
</div>
</div>
</>
)}
</main>
);
}
Expand Down
Loading

0 comments on commit d966a2e

Please sign in to comment.