Skip to content

Commit

Permalink
Resolved the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-01k committed Feb 10, 2025
1 parent 9d972cf commit 295aad8
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 310 deletions.
2 changes: 1 addition & 1 deletion examples/core-connection/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getBlocksCSSVariables, themeConfig } from 'shared-components';
import { useDarkMode } from './common/hooks';
import { RouterContainer } from './common/components';
import { GlobalProvider } from './context/GlobalContext';
import { CONSTANTS, PushWalletProvider } from '../../../packages/ui-kit';
import { CONSTANTS, PushWalletProvider } from '@pushprotocol/pushchain-ui-kit';

const GlobalStyle = createGlobalStyle`
:root{
Expand Down
1 change: 0 additions & 1 deletion examples/core-connection/src/common/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const APP_ROUTES = {
LANDING_PAGE: '/',
SIMULATE: '/simulate',
WALLETPAGE: '/wallet-page',
};
2 changes: 1 addition & 1 deletion examples/core-connection/src/context/GlobalContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useEffect,
useState,
} from 'react';
import { usePushWalletContext } from '../../../../packages/ui-kit';
import { usePushWalletContext } from '@pushprotocol/pushchain-ui-kit';

// Define a type for the context value
type GlobalContextType = {
Expand Down
2 changes: 1 addition & 1 deletion examples/core-connection/src/helpers/walletHelper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UniversalAddress } from '../../../../packages/ui-kit/src';
import { UniversalAddress } from '@pushprotocol/pushchain-ui-kit';

export function centerMaskString(str: string) {
if (str && str.length > 15) {
Expand Down
59 changes: 0 additions & 59 deletions examples/core-connection/src/modules/WalletTestPage/WalletPage.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SimulateTxText } from './SimulateTxText';
import {
PushWalletButton,
usePushWalletContext,
} from '../../../../../../packages/ui-kit/src';
} from '@pushprotocol/pushchain-ui-kit';

const LandingPageLeftComponent = () => {
const { pushNetwork, mockTx } = useGlobalContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TransactionSnippet } from '../../../common/components';
import { useGlobalContext } from '../../../context/GlobalContext';
import { Transaction } from '@pushprotocol/push-chain/src/lib/generated/tx';
import { centerMaskString, convertToCaip } from '../../../helpers';
import { usePushWalletContext } from '../../../../../../packages/ui-kit/src';
import { usePushWalletContext } from '@pushprotocol/pushchain-ui-kit';

const MockSendTransaction = () => {
const { pushNetwork, mockTx } = useGlobalContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box } from 'shared-components';
import {
PushWalletButton,
usePushWalletContext,
} from '../../../../../../packages/ui-kit';
} from '@pushprotocol/pushchain-ui-kit';

const SimulateHeader = () => {
const { universalAddress } = usePushWalletContext();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FC } from 'react';
import { usePushWalletContext } from './PushWalletProvider';
import { walletConnectionButtonStatusMapper } from '../wallet.constants';
import styled from 'styled-components';
import { Spinner } from '../../common';

Expand Down Expand Up @@ -41,7 +40,6 @@ const ConnectPushWalletButton: FC<ConnectPushWalletButtonProps> = ({
disabled={isConnectButtonDisbaled || isLoading}
customStyle={styling}
>
{/* {walletConnectionButtonStatusMapper[connectionStatus]} */}
{connectionStatus === 'notConnected' ? title : connectionStatus}
{isLoading && (
<SpinnerContainer>
Expand Down
19 changes: 6 additions & 13 deletions packages/ui-kit/src/lib/wallet/components/PushWalletButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@ const PushWalletButton: React.FC<PushWalletButtonProps> = ({
title = 'Login',
styling,
}) => {
// If a custom component is provided, render it
if (component) {
// If universal address is present render the button
if (universalAddress) {
return <TogglePushWalletButton universalAddress={universalAddress} />;
} else if (component) {
// If no UA and custom component, then render the component
return <>{component}</>;
}

return (
<>
{universalAddress ? (
<TogglePushWalletButton universalAddress={universalAddress} />
) : (
<ConnectPushWalletButton title={title} styling={styling} />
)}
</>
);
} else return <ConnectPushWalletButton title={title} styling={styling} />; // If no UA and no custom component, then render the connect button
};

export { PushWalletButton };
176 changes: 0 additions & 176 deletions packages/ui-kit/src/lib/wallet/components/PushWalletIFrame.tsx

This file was deleted.

Loading

0 comments on commit 295aad8

Please sign in to comment.