-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Registration Page * feat: Register page * feat: new modal design & generate proof modal * fix: add box-shadow to modal --------- Co-authored-by: Chqrles <[email protected]>
- Loading branch information
Showing
12 changed files
with
323 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<Content title="Proof generation"> | ||
<Column gap={42} alignItems="center"> | ||
<Column gap={16}> | ||
<Logo width={42} height={42} /> | ||
|
||
<ThemedText.HeadlineSmall>Snarkification of the elliptic curve...</ThemedText.HeadlineSmall> | ||
</Column> | ||
|
||
<ThemedText.BodySecondary fontSize={16}>This might take a while</ThemedText.BodySecondary> | ||
</Column> | ||
</Content> | ||
) | ||
} | ||
|
||
export default function GenerateProofModal() { | ||
return ( | ||
<Portal> | ||
<GenerateProofModalContent /> | ||
|
||
<Overlay /> | ||
</Portal> | ||
) | ||
} |
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,125 @@ | ||
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' | ||
|
||
const Layout = styled(Column)` | ||
width: 100%; | ||
margin: 0 auto; | ||
justify-content: center; | ||
flex: 1; | ||
` | ||
|
||
const Content = styled(Column)` | ||
max-width: 464px; | ||
width: 100%; | ||
` | ||
|
||
const Headline = styled(Row)` | ||
width: 100%; | ||
justify-content: space-between; | ||
margin-bottom: ${({ theme }) => theme.grids.md}; | ||
` | ||
|
||
const ContentCard = styled(Column)` | ||
width: 100%; | ||
border-radius: 12px; | ||
overflow: hidden; | ||
` | ||
|
||
const NoDataCard = styled(Column)` | ||
width: 100%; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 32px 0; | ||
background-color: ${({ theme }) => theme.bg3}; | ||
` | ||
|
||
const RevtagCard = styled(Row)` | ||
width: 100%; | ||
justify-content: space-between; | ||
padding: 24px 16px; | ||
background-color: ${({ theme }) => theme.bg3}; | ||
` | ||
|
||
const ProofCard = styled(Row)` | ||
width: 100%; | ||
justify-content: flex-end; | ||
gap: 8px; | ||
padding: 16px; | ||
background-color: ${({ theme }) => theme.bg2}; | ||
` | ||
|
||
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 ( | ||
<Layout> | ||
<Content gap={12}> | ||
<Headline> | ||
<ThemedText.HeadlineLarge>Register</ThemedText.HeadlineLarge> | ||
</Headline> | ||
|
||
{!revtag && ( | ||
<> | ||
<ContentCard> | ||
<NoDataCard> | ||
<ThemedText.Title fontWeight={500}>No data detected</ThemedText.Title> | ||
</NoDataCard> | ||
</ContentCard> | ||
|
||
<PrimaryButton onClick={() => setRevtag('chqrlesjuzw')}> | ||
<ThemedText.Title>Open sidebar</ThemedText.Title> | ||
</PrimaryButton> | ||
</> | ||
)} | ||
|
||
{revtag && ( | ||
<> | ||
<ContentCard> | ||
<RevtagCard> | ||
<ThemedText.BodyPrimary>Revtag:</ThemedText.BodyPrimary> | ||
<ThemedText.BodyPrimary fontWeight={500}>{revtag}</ThemedText.BodyPrimary> | ||
</RevtagCard> | ||
|
||
<ProofCard> | ||
{proven ? ( | ||
<LockClosed width={18} height={18} color={theme.green} /> | ||
) : ( | ||
<LockOpen width={18} height={18} color={theme.neutral2} /> | ||
)} | ||
|
||
{proven ? ( | ||
<ThemedText.BodyPrimary>Proved</ThemedText.BodyPrimary> | ||
) : ( | ||
<ThemedText.BodySecondary fontWeight={500}>Unproved</ThemedText.BodySecondary> | ||
)} | ||
</ProofCard> | ||
</ContentCard> | ||
|
||
<PrimaryButton onClick={() => !proven && setGeneratingProof(true)}> | ||
<ThemedText.Title>{proven ? 'Complete registration' : 'Generate proof'}</ThemedText.Title> | ||
</PrimaryButton> | ||
</> | ||
)} | ||
</Content> | ||
|
||
{generatingProof && <GenerateProofModal />} | ||
</Layout> | ||
) | ||
} |
Oops, something went wrong.