-
Notifications
You must be signed in to change notification settings - Fork 3
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 #346 from polkadot-ui/nik-beautify-connect
Make wallet connect work in popup
- Loading branch information
Showing
9 changed files
with
154 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { FC } from "react" | ||
|
||
import { PropsWithChildren, useEffect, useState } from "react" | ||
import { ConnectIF } from "./types" | ||
import { Connect } from "./Connect" | ||
|
||
export const ConnectModal: FC< | ||
PropsWithChildren & | ||
ConnectIF & { | ||
title: string | ||
show: boolean | ||
onClose: (a: boolean) => void | ||
} | ||
> = ({ | ||
title, | ||
show, | ||
onClose, | ||
selected, | ||
setSelected, | ||
config, | ||
type = "onepage", | ||
onSelectExtensions, | ||
getConnectedAccounts, | ||
}) => { | ||
const [sh, setSh] = useState(false) | ||
|
||
const closeHandler = () => { | ||
setSh(false) | ||
onClose(false) | ||
} | ||
|
||
useEffect(() => { | ||
setSh(show) | ||
}, [show]) | ||
|
||
return ( | ||
<div | ||
style={{ | ||
visibility: sh ? "visible" : "hidden", | ||
opacity: sh ? "1" : "0", | ||
position: "fixed", | ||
top: 0, | ||
bottom: 0, | ||
left: 0, | ||
right: 0, | ||
background: "#ccc", | ||
transition: "opacity 500ms", | ||
}} | ||
> | ||
<div | ||
style={{ | ||
margin: "70px auto", | ||
padding: "20px", | ||
background: "#fff", | ||
borderRadius: "5px", | ||
position: "relative", | ||
transition: "all 5s ease-in-out", | ||
}} | ||
> | ||
<h2 style={{ marginTop: 0 }}>{title}</h2> | ||
<span | ||
style={{ | ||
position: "absolute", | ||
top: "20px", | ||
right: "30px", | ||
transition: "all 200ms", | ||
fontSize: "30px", | ||
fontWeight: "bold", | ||
textDecoration: "none", | ||
color: "#333", | ||
cursor: "pointer", | ||
}} | ||
onClick={closeHandler} | ||
> | ||
× | ||
</span> | ||
<Connect | ||
type={type} | ||
selected={selected} | ||
setSelected={setSelected} | ||
config={config} | ||
getConnectedAccounts={getConnectedAccounts} | ||
onSelectExtensions={onSelectExtensions} | ||
/> | ||
</div> | ||
</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
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,7 +1,7 @@ | ||
{ | ||
"name": "@polkadot-ui/react", | ||
"license": "MIT", | ||
"version": "0.0.1-alpha.31", | ||
"version": "0.0.1-alpha.33", | ||
"author": "Nikolaos Kontakis<[email protected]>", | ||
"type": "module", | ||
"description": "Functional React components for Polkadot dApps.", | ||
|
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