Skip to content
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

more fixes #353

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions packages/ui-react/lib/components/Connect/ConnectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Connect } from "./Connect"
export const ConnectModal: FC<
PropsWithChildren &
ConnectIF & {
title: string
title?: string
show: boolean
onClose: (a: boolean) => void
}
Expand Down Expand Up @@ -43,37 +43,49 @@ export const ConnectModal: FC<
bottom: 0,
left: 0,
right: 0,
background: "#ccc",
background: config?.modal?.areaColor || `rgba(82,82,82,0.9)`,
transition: "opacity 500ms",
}}
>
<div
style={{
margin: "70px auto",
padding: "20px",
background: "#fff",
borderRadius: "5px",
display: "flex",
margin: config?.modal?.margin || "0 auto",
padding: config?.modal?.padding || "2rem",
background: config?.modal?.bgColor || "#fff",
borderRadius: config?.modal?.borderRadius || "1rem",
position: "relative",
transition: "all 5s ease-in-out",
height: "fit-content",
width: config?.modal?.width,
top: config?.modal?.top || "30%",
flexDirection: "column",
}}
>
<h2 style={{ marginTop: 0 }}>{title}</h2>
<span
<div
style={{
position: "absolute",
top: "20px",
right: "30px",
transition: "all 200ms",
fontSize: "30px",
color: config?.modal?.titleColor || "#000",
fontSize: "1.5rem",
fontWeight: "bold",
textDecoration: "none",
color: "#333",
cursor: "pointer",
}}
onClick={closeHandler}
>
&times;
</span>
<span>{title}</span>
<span
style={{
position: "absolute",
top: "2rem",
right: "2.5rem",
transition: "all 200ms",
fontSize: "2.5rem",
fontWeight: "bold",
textDecoration: "none",
cursor: "pointer",
}}
onClick={closeHandler}
>
&times;
</span>
</div>
<Connect
type={type}
selected={selected}
Expand Down
10 changes: 10 additions & 0 deletions packages/ui-react/lib/components/Connect/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ export type ConfigType = {
}

export type CommonConfigType = {
modal?: {
areaColor?: string
bgColor?: string
titleColor?: string
borderRadius?: string
padding?: string
margin?: string
width?: string
top?: string
}
bg?: {
color?: string
selected?: string
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/package.json
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.33",
"version": "0.0.1-alpha.34",
"author": "Nikolaos Kontakis<[email protected]>",
"type": "module",
"description": "Functional React components for Polkadot dApps.",
Expand Down
8 changes: 5 additions & 3 deletions sandbox/src/pages/ConnectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ export const ConnectPage = () => {
width: 4,
height: 2,
},
modal: {
width: "50vw",
top: "30vh",
},
}

console.log(selectedAccount)

return (
<div className="page">
<h1>Connect</h1>
Expand Down Expand Up @@ -51,7 +53,7 @@ export const ConnectPage = () => {
}}
>
<ConnectModal
title={"title"}
title={"Connect Wallet"}
onClose={() => setIsOpen(false)}
show={isOpen}
type="split"
Expand Down