-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from push-protocol/UI-KIT-49-fixed-ui-kit-expo…
…rt-for-account Redefining UI-Kit component and functions exports
- Loading branch information
Showing
15 changed files
with
183 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
examples/core-connection/src/modules/simulatePage/components/SimulateHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/ui-kit/src/lib/wallet/components/PushWalletButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { ConnectPushWalletButton } from './ConnectPushWalletButton'; | ||
import { TogglePushWalletButton } from './TogglePushWalletButton'; | ||
import { UniversalAddress } from '../wallet.types'; | ||
|
||
type PushWalletButtonProps = { | ||
universalAddress: UniversalAddress | null; | ||
component?: ReactNode; | ||
title?: string; | ||
styling?: React.CSSProperties; | ||
}; | ||
|
||
const PushWalletButton: React.FC<PushWalletButtonProps> = ({ | ||
universalAddress, | ||
component, | ||
title = 'Login', | ||
styling, | ||
}) => { | ||
// 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}</>; | ||
} else return <ConnectPushWalletButton title={title} styling={styling} />; // If no UA and no custom component, then render the connect button | ||
}; | ||
|
||
export { PushWalletButton }; |
Oops, something went wrong.