-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adjusted styling * Removed log * Adjusted styling * Added iconsOnly prop to hide selectedChain name * Added wallet action * Only enable export action if selected wallet is a privy wallet
- Loading branch information
1 parent
71efaad
commit ae08e2d
Showing
6 changed files
with
137 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default function WalletAction({ id, label, icon, onClick }: any) { | ||
return ( | ||
<div | ||
id={id} | ||
className="flex flex-col justify-start items-center w-[40px] h-[40px]" | ||
> | ||
<button | ||
className="w-[35px] h-[35px] flex justify-center items-center gradient-2 p-1 pr-2 pl-2 rounded-full" | ||
onClick={onClick} | ||
> | ||
{icon} | ||
</button> | ||
<p className="mt-1 text-xs text-center">{label}</p> | ||
</div> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ArrowUpRightIcon } from '@heroicons/react/24/outline' | ||
import WalletAction from '@/components/privy/WalletAction' | ||
|
||
// Example icon | ||
|
||
describe('WalletAction Component', () => { | ||
let props: any | ||
|
||
beforeEach(() => { | ||
props = { | ||
id: 'test-wallet-action', | ||
label: 'Test Wallet Action', | ||
icon: <ArrowUpRightIcon />, | ||
onClick: cy.spy().as('clickHandler'), | ||
} | ||
|
||
cy.mount(<WalletAction {...props} />) | ||
}) | ||
|
||
it('Renders component', () => { | ||
// Check if component renders with correct structure | ||
cy.get('#test-wallet-action').should('exist') | ||
cy.get('button').should('exist') | ||
cy.get('p').should('have.text', 'Test Wallet Action') | ||
|
||
// Test click functionality | ||
cy.get('button').click() | ||
cy.get('@clickHandler').should('have.been.called') | ||
}) | ||
}) |
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