-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: add support of xdefi wallet #134
Open
hinterlist
wants to merge
1
commit into
terra-money:main
Choose a base branch
from
hinterlist:feat/upgrade-wallet-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { ReactElement } from 'react' | ||
import styled from 'styled-components' | ||
import { useRecoilState } from 'recoil' | ||
|
||
import { NETWORK } from 'consts' | ||
|
||
import { Text } from 'components' | ||
import Button from 'components/Button' | ||
import DefaultModal from 'components/Modal' | ||
import ExtLink from 'components/ExtLink' | ||
|
||
import SelectWalletStore, { | ||
SelectWalletModalType, | ||
} from 'store/SelectWalletStore' | ||
|
||
const StyledContainer = styled.div` | ||
padding: 0 30px 30px; | ||
` | ||
|
||
const XDefiExtensionDownModal = (): ReactElement => { | ||
const handleInstalled = (): void => { | ||
window.location.reload() | ||
} | ||
|
||
const [isVisibleModalType, setIsVisibleModalType] = useRecoilState( | ||
SelectWalletStore.isVisibleModalType | ||
) | ||
return ( | ||
<DefaultModal | ||
{...{ | ||
isOpen: isVisibleModalType === SelectWalletModalType.xdefiExtInstall, | ||
close: (): void => { | ||
setIsVisibleModalType(undefined) | ||
}, | ||
}} | ||
> | ||
<StyledContainer> | ||
{!navigator.userAgent.includes('Chrome') ? ( | ||
<div style={{ textAlign: 'center' }}> | ||
<Text style={{ fontSize: 18 }}> | ||
{'Bridge currently\nonly supports desktop Chrome'} | ||
</Text> | ||
<br /> | ||
<ExtLink href={NETWORK.CHROME}> | ||
<Text | ||
style={{ | ||
color: 'inherit', | ||
fontSize: 18, | ||
marginTop: 10, | ||
marginBottom: 30, | ||
}} | ||
> | ||
Download Chrome | ||
</Text> | ||
</ExtLink> | ||
</div> | ||
) : ( | ||
<> | ||
<div> | ||
<ExtLink href={NETWORK.XDEFI_EXTENSION}> | ||
<Text style={{ color: 'inherit', fontSize: 18 }}> | ||
Download XDEFI Wallet Extension | ||
</Text> | ||
</ExtLink> | ||
<br /> | ||
<Text style={{ fontSize: 18 }}>{'to connect your wallet'}</Text> | ||
</div> | ||
<br /> | ||
<Button onClick={handleInstalled}>I installed it.</Button> | ||
</> | ||
)} | ||
</StyledContainer> | ||
</DefaultModal> | ||
) | ||
} | ||
|
||
export default XDefiExtensionDownModal |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
export type NominalType<T extends string> = { __type: T } | ||
|
||
declare global { | ||
interface Window { | ||
xfi: any | ||
} | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@dimitrykislichenko it doesn't work for me,
with the Prioritise XDEFI wallet option enabled i receive an error in this line:
without the prioritise option it doesn't detect the wallet
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.
sorry I made the comment some time ago, now it detect the extension without the prioritise option.
But it is still throwing the Cannot read properties of undefined (reading 'address') error
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.
Manage your work-related matters with patience.
Sometimes the problem is not the program and the solution is waiting
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.
What?? 🤔