Skip to content

Commit

Permalink
style: adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Dec 3, 2024
1 parent 27420dc commit 808a609
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 45 deletions.
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/polkagate/snap.git"
},
"source": {
"shasum": "flkcFX8cjYKY3EpliVGWTBxLdwF6GoY8ZWbJPWSZivg=",
"shasum": "DQnCLJLh1R+vr3YG+b2R0WNQya1/ibMwh5nFDBlOu0s=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
9 changes: 1 addition & 8 deletions packages/snap/src/listeners/onInstall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

import type { OnInstallHandler } from '@metamask/snaps-sdk';

import { getKeyPair } from '../util';
import { POLKADOT_GENESIS } from '@polkadot/apps-config';
import { getLogoByGenesisHash } from '../ui/image/chains/getLogoByGenesisHash';
import { setSnapState } from '../rpc/stateManagement';
import { welcomeScreen } from '../ui/welcomeScreen';

Expand All @@ -18,16 +16,11 @@ import { welcomeScreen } from '../ui/welcomeScreen';
export const onInstall: OnInstallHandler = async () => {
setSnapState({ currentGenesisHash: POLKADOT_GENESIS }).catch(console.error);

const genesisHash = POLKADOT_GENESIS;
const { address } = await getKeyPair(undefined, genesisHash);
const logo = await getLogoByGenesisHash(genesisHash)


await snap.request({
method: 'snap_dialog',
params: {
type: 'alert',
content: welcomeScreen(address, genesisHash, logo)
content: welcomeScreen()
},
});
};
4 changes: 2 additions & 2 deletions packages/snap/src/ui/components/ChainSwitch.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2023-2024 @polkagate/snap authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { Box, Option, SnapComponent, Dropdown, Image, Text } from "@metamask/snaps-sdk/jsx";
import { Box, Option, SnapComponent, Dropdown, Image } from "@metamask/snaps-sdk/jsx";
import { getChainOptions } from "../../chains";
import { HexString } from "@polkadot/util/types";

Expand All @@ -14,7 +14,7 @@ export const ChainSwitch: SnapComponent<Props> = ({ genesisHash, logo }: Props)
const options = getChainOptions()

return (
<Box direction="horizontal" alignment="space-between">
<Box direction="horizontal" alignment="center">
<Image src={logo} />
<Dropdown name="switchChain" value={genesisHash}>
{options.map(({ value, text }) => (
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/acala.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions packages/snap/src/ui/image/chains/ajuna.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/assetHub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/basilisk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/bifrost.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/centrifuge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/composable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/darwinia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/globe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/hydradx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/karura.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/src/ui/image/chains/kulupu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 808a609

Please sign in to comment.