Skip to content

Commit 295aad8

Browse files
committed
Resolved the comments
1 parent 9d972cf commit 295aad8

File tree

14 files changed

+15
-310
lines changed

14 files changed

+15
-310
lines changed

examples/core-connection/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getBlocksCSSVariables, themeConfig } from 'shared-components';
55
import { useDarkMode } from './common/hooks';
66
import { RouterContainer } from './common/components';
77
import { GlobalProvider } from './context/GlobalContext';
8-
import { CONSTANTS, PushWalletProvider } from '../../../packages/ui-kit';
8+
import { CONSTANTS, PushWalletProvider } from '@pushprotocol/pushchain-ui-kit';
99

1010
const GlobalStyle = createGlobalStyle`
1111
:root{
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const APP_ROUTES = {
22
LANDING_PAGE: '/',
33
SIMULATE: '/simulate',
4-
WALLETPAGE: '/wallet-page',
54
};

examples/core-connection/src/context/GlobalContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useEffect,
99
useState,
1010
} from 'react';
11-
import { usePushWalletContext } from '../../../../packages/ui-kit';
11+
import { usePushWalletContext } from '@pushprotocol/pushchain-ui-kit';
1212

1313
// Define a type for the context value
1414
type GlobalContextType = {

examples/core-connection/src/helpers/walletHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UniversalAddress } from '../../../../packages/ui-kit/src';
1+
import { UniversalAddress } from '@pushprotocol/pushchain-ui-kit';
22

33
export function centerMaskString(str: string) {
44
if (str && str.length > 15) {

examples/core-connection/src/modules/WalletTestPage/WalletPage.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

examples/core-connection/src/modules/landingPage/components/LandingPageLeftComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SimulateTxText } from './SimulateTxText';
66
import {
77
PushWalletButton,
88
usePushWalletContext,
9-
} from '../../../../../../packages/ui-kit/src';
9+
} from '@pushprotocol/pushchain-ui-kit';
1010

1111
const LandingPageLeftComponent = () => {
1212
const { pushNetwork, mockTx } = useGlobalContext();

examples/core-connection/src/modules/simulatePage/components/MockSendTransaction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TransactionSnippet } from '../../../common/components';
55
import { useGlobalContext } from '../../../context/GlobalContext';
66
import { Transaction } from '@pushprotocol/push-chain/src/lib/generated/tx';
77
import { centerMaskString, convertToCaip } from '../../../helpers';
8-
import { usePushWalletContext } from '../../../../../../packages/ui-kit/src';
8+
import { usePushWalletContext } from '@pushprotocol/pushchain-ui-kit';
99

1010
const MockSendTransaction = () => {
1111
const { pushNetwork, mockTx } = useGlobalContext();

examples/core-connection/src/modules/simulatePage/components/SimulateHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Box } from 'shared-components';
22
import {
33
PushWalletButton,
44
usePushWalletContext,
5-
} from '../../../../../../packages/ui-kit';
5+
} from '@pushprotocol/pushchain-ui-kit';
66

77
const SimulateHeader = () => {
88
const { universalAddress } = usePushWalletContext();

packages/ui-kit/src/lib/wallet/components/ConnectPushWalletButton.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { FC } from 'react';
22
import { usePushWalletContext } from './PushWalletProvider';
3-
import { walletConnectionButtonStatusMapper } from '../wallet.constants';
43
import styled from 'styled-components';
54
import { Spinner } from '../../common';
65

@@ -41,7 +40,6 @@ const ConnectPushWalletButton: FC<ConnectPushWalletButtonProps> = ({
4140
disabled={isConnectButtonDisbaled || isLoading}
4241
customStyle={styling}
4342
>
44-
{/* {walletConnectionButtonStatusMapper[connectionStatus]} */}
4543
{connectionStatus === 'notConnected' ? title : connectionStatus}
4644
{isLoading && (
4745
<SpinnerContainer>

packages/ui-kit/src/lib/wallet/components/PushWalletButton.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,13 @@ const PushWalletButton: React.FC<PushWalletButtonProps> = ({
1616
title = 'Login',
1717
styling,
1818
}) => {
19-
// If a custom component is provided, render it
20-
if (component) {
19+
// If universal address is present render the button
20+
if (universalAddress) {
21+
return <TogglePushWalletButton universalAddress={universalAddress} />;
22+
} else if (component) {
23+
// If no UA and custom component, then render the component
2124
return <>{component}</>;
22-
}
23-
24-
return (
25-
<>
26-
{universalAddress ? (
27-
<TogglePushWalletButton universalAddress={universalAddress} />
28-
) : (
29-
<ConnectPushWalletButton title={title} styling={styling} />
30-
)}
31-
</>
32-
);
25+
} else return <ConnectPushWalletButton title={title} styling={styling} />; // If no UA and no custom component, then render the connect button
3326
};
3427

3528
export { PushWalletButton };

0 commit comments

Comments
 (0)