-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dimitry Kislichenko
committed
Apr 12, 2022
1 parent
0f04303
commit b918e56
Showing
9 changed files
with
127 additions
and
1 deletion.
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