diff --git a/client/src/components/GenerateProofModal/index.tsx b/client/src/components/GenerateProofModal/index.tsx
new file mode 100644
index 0000000..c249c78
--- /dev/null
+++ b/client/src/components/GenerateProofModal/index.tsx
@@ -0,0 +1,33 @@
+import { ThemedText } from 'src/theme/components'
+import { Logo } from 'src/theme/components/icons'
+
+import { Column } from '../Flex'
+import Content from '../Modal/Content'
+import Overlay from '../Modal/Overlay'
+import Portal from '../Portal'
+
+function GenerateProofModalContent() {
+ return (
+
+
+
+
+
+ Snarkification of the elliptic curve...
+
+
+ This might take a while
+
+
+ )
+}
+
+export default function GenerateProofModal() {
+ return (
+
+
+
+
+
+ )
+}
diff --git a/client/src/components/Modal/Content.tsx b/client/src/components/Modal/Content.tsx
index 558c47b..853d1cc 100644
--- a/client/src/components/Modal/Content.tsx
+++ b/client/src/components/Modal/Content.tsx
@@ -5,73 +5,56 @@ import { styled } from 'styled-components'
import { Column, Row } from '../Flex'
const StyledContent = styled.div`
- border: 3px solid ${({ theme }) => theme.neutral1};
- padding: 80px 32px;
- background: ${({ theme }) => theme.bg1};
- z-index: 1060;
position: fixed;
- width: 100%;
- top: 0;
- bottom: 0;
+ z-index: 1060;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
justify-content: center;
-
- @media only screen and (min-width: ${({ theme }) => `${theme.breakpoint.xs}px`}) {
- left: 50%;
- top: 50%;
- width: 386px;
- transform: translate(-50%, -50%);
- padding: 32px;
- bottom: unset;
- }
+ width: 100%;
+ max-width: 480px;
+ padding: 16px;
+ background: ${({ theme }) => theme.bg2};
+ border: 1px solid ${({ theme }) => theme.border};
+ border-radius: 20px;
`
const TitleContainer = styled(Row)`
- position: absolute;
width: 100%;
- padding: 0 4px;
- text-align: center;
- top: 16px;
-
- & > div {
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- width: 100%;
- }
+`
- @media only screen and (min-width: ${({ theme }) => `${theme.breakpoint.xs}px`}) {
- top: -32px;
- text-align: left;
- }
+const Title = styled(ThemedText.HeadlineSmall)`
+ width: 100%;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
`
-const CloseContainer = styled.div`
- position: absolute;
- color: ${({ theme }) => theme.neutral1};
+const CloseContainer = styled.button`
width: 28px;
height: 28px;
padding: 4px;
+ background: transparent;
+ color: ${({ theme }) => theme.neutral1};
+ border: none;
cursor: pointer;
- border: 3px solid ${({ theme }) => theme.neutral1};
- top: -3px;
- right: -3px;
+ transition: color 0.15s linear;
& > svg {
display: block;
}
&:hover {
- background: ${({ theme }) => theme.neutral1};
- color: ${({ theme }) => theme.bg1};
+ color: ${({ theme }) => theme.neutral2};
}
`
interface ContentProps {
children: React.ReactNode
title: string
- close: () => void
+ close?: () => void
}
export default function Content({ children, title, close }: ContentProps) {
@@ -79,12 +62,14 @@ export default function Content({ children, title, close }: ContentProps) {
- {title}
-
+ {title}
-
-
-
+ {close && (
+
+
+
+ )}
+
{children}
diff --git a/client/src/components/Modal/Overlay.tsx b/client/src/components/Modal/Overlay.tsx
index 4e6b4bf..8f5a2ea 100644
--- a/client/src/components/Modal/Overlay.tsx
+++ b/client/src/components/Modal/Overlay.tsx
@@ -15,7 +15,7 @@ const StyledOverlay = styled.div`
`
interface OverlayProps {
- onClick: () => void
+ onClick?: () => void
}
export default function Overlay({ onClick }: OverlayProps) {
diff --git a/client/src/pages/Register.tsx b/client/src/pages/Register.tsx
index 379dc86..31c2391 100644
--- a/client/src/pages/Register.tsx
+++ b/client/src/pages/Register.tsx
@@ -1,6 +1,7 @@
-import { useState } from 'react'
+import { useEffect, useState } from 'react'
import { PrimaryButton } from 'src/components/Button'
import { Column, Row } from 'src/components/Flex'
+import GenerateProofModal from 'src/components/GenerateProofModal'
import { ThemedText } from 'src/theme/components'
import { LockClosed, LockOpen } from 'src/theme/components/icons'
import { styled, useTheme } from 'styled-components'
@@ -55,8 +56,18 @@ const ProofCard = styled(Row)`
export default function RegisterPage() {
const theme = useTheme()
const [revtag, setRevtag] = useState('')
+ const [generatingProof, setGeneratingProof] = useState(false)
const [proven, setProven] = useState(false)
+ useEffect(() => {
+ if (generatingProof) {
+ setTimeout(() => {
+ setProven(true)
+ setGeneratingProof(false)
+ }, 5_000)
+ }
+ }, [generatingProof])
+
return (
@@ -101,12 +112,14 @@ export default function RegisterPage() {
- setProven(true)}>
+ !proven && setGeneratingProof(true)}>
{proven ? 'Complete registration' : 'Generate proof'}
>
)}
+
+ {generatingProof && }
)
}