-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect wallet button [interchain UI part 2] #1014
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ export const IbcChainProvider = ({ registry, children }: IbcProviderProps) => { | |
}, | ||
}} | ||
signerOptions={signerOptions} | ||
modalTheme={{ defaultTheme: 'light' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the default changed to dark. Forcing the light theme here. |
||
> | ||
{children} | ||
</ChainProvider> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useStore } from '../../../state'; | ||
import { ibcInSelector } from '../../../state/ibc-in'; | ||
import { useChain, useManager } from '@cosmos-kit/react'; | ||
import { WalletStatus } from '@cosmos-kit/core'; | ||
import { WalletAddrCard } from './wallet-addr-card'; | ||
import { ConnectWalletButton } from './wallet-connect-button'; | ||
|
||
export const useChainConnector = () => { | ||
const { selectedChain } = useStore(ibcInSelector); | ||
const { chainRecords } = useManager(); | ||
const defaultChain = chainRecords[0]!.name; | ||
return useChain(selectedChain?.chainName ?? defaultChain); | ||
}; | ||
|
||
export const CosmosWalletConnector = () => { | ||
const { selectedChain } = useStore(ibcInSelector); | ||
const { username, address, status, message } = useChainConnector(); | ||
|
||
return ( | ||
<div className='flex flex-col items-center justify-center gap-4'> | ||
{address && selectedChain && <WalletAddrCard username={username} address={address} />} | ||
<div className='w-52'> | ||
<ConnectWalletButton /> | ||
</div> | ||
{(status === WalletStatus.Rejected || status === WalletStatus.Error) && ( | ||
<div className='text-purple-500'>{message}</div> | ||
)} | ||
</div> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ export const IbcInForm = () => { | |
}} | ||
> | ||
<InterchainUi /> | ||
<Button type='submit' variant='onLight'> | ||
<Button type='submit' variant='onLight' disabled> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disabling until we get to the end of building this flow |
||
<div className='flex items-center gap-2'> | ||
<LockClosedIcon /> | ||
<span className='-mb-1'>Shield Assets</span> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; | ||
|
||
interface UserInfoProps { | ||
address: string; | ||
username?: string; | ||
} | ||
|
||
export const WalletAddrCard = ({ address, username }: UserInfoProps) => { | ||
return ( | ||
<div className='flex flex-col items-center gap-2 space-y-1 rounded-lg bg-white p-6'> | ||
<Identicon uniqueIdentifier={address} type='gradient' size={42} /> | ||
<div className='flex items-center justify-center gap-4 text-gray-500'>{address}</div> | ||
<span className='text-sm font-semibold text-stone-700 sm:text-xl'>{username}</span> | ||
</div> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Component completely broken after interchain deps update. Went ahead and swapped it out for https://ui.shadcn.com/docs/components/combobox